James Yonan <j...@yonan.net>: > Interesting. I wonder if a better solution might be to bracket the > struct openvpn_pktinfo definition with > > #pragma pack(1) > ... > #pragma pack()
Yes, although gcc is allergic to #pragma's. The gcc way of expressing it is: struct __attribute__ ((__packed__)) my_packed_struct { char c; int i; struct my_unpacked_struct s; }; (from "info gcc" -> "C Extensions" -> "Type Attributes"). Marko