Hi, > Whenever the byte in memory is half-word-aligned, reading it as a uint16 > works as expected. The other half of the time, the compiler is adjusting > the pointer (back one) to make it half-word-aligned before reading the two > bytes as a uint16.
Yes, it seems that some ARM CPUs don't like unaligned (half-)word reads. > I can find at least 26 occasions in the strongSwan code where this > reading-a-byte-pointer-as-a-uint16-pointer idiom occurs. I think not all of them are problematic. GCC should align struct members properly, so read/write to struct members shouldn't be a problem (except __packed__ ones, I'll review those). I've removed any reads to unaligned integers in the parser code [1], generator looks OK so far. I don't have an ARM box, so any feedback is very welcome. Thanks Martin [1]http://wiki.strongswan.org/repositories/diff/strongswan?rev=42748858 _______________________________________________ Users mailing list Users@lists.strongswan.org https://lists.strongswan.org/mailman/listinfo/users