diff options
author | rwatson <rwatson@FreeBSD.org> | 2007-06-28 12:54:58 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2007-06-28 12:54:58 +0000 |
commit | 4b7d057bea2b5be36228b873bf858f8974e0de68 (patch) | |
tree | 0463298f60a2018e240aec4c8494d2f7ae37c08e /sys/netatalk | |
parent | 6aa9e3572e7fac82c3e1ab99331115d32b970a53 (diff) | |
download | FreeBSD-src-4b7d057bea2b5be36228b873bf858f8974e0de68.zip FreeBSD-src-4b7d057bea2b5be36228b873bf858f8974e0de68.tar.gz |
Mark wire data structures in netatalk as __packed so that they are
properly (un)padded on the arm platform. With this change, FreeBSD/arm
boxes are able to route AppleTalk properly.
Submitted/tested by: Nathan Whitehorn <nathanw at uchicago dot edu>
Tested on: arm, i386, amd64
Approved by: re (kensmith)
Diffstat (limited to 'sys/netatalk')
-rw-r--r-- | sys/netatalk/aarp.h | 5 | ||||
-rw-r--r-- | sys/netatalk/ddp.h | 11 |
2 files changed, 9 insertions, 7 deletions
diff --git a/sys/netatalk/aarp.h b/sys/netatalk/aarp.h index b57d3c9..b55a9a7 100644 --- a/sys/netatalk/aarp.h +++ b/sys/netatalk/aarp.h @@ -42,7 +42,7 @@ union aapa { u_char an_zero; u_char an_net[2]; u_char an_node; - } ap_node; + } __packed ap_node; }; struct ether_aarp { @@ -51,7 +51,8 @@ struct ether_aarp { union aapa aarp_spu; u_char aarp_tha[6]; union aapa aarp_tpu; -}; +} __packed; + #define aarp_hrd eaa_hdr.ar_hrd #define aarp_pro eaa_hdr.ar_pro #define aarp_hln eaa_hdr.ar_hln diff --git a/sys/netatalk/ddp.h b/sys/netatalk/ddp.h index 55b55c8..1867ae4 100644 --- a/sys/netatalk/ddp.h +++ b/sys/netatalk/ddp.h @@ -64,7 +64,7 @@ struct elaphdr { u_char el_dnode; u_char el_snode; u_char el_type; -}; +} __packed; #define SZ_ELAPHDR 3 @@ -90,7 +90,7 @@ struct ddpehdr { unsigned dub_hops:4; unsigned dub_pad:2; #endif - } du_bits; + } __packed du_bits; unsigned du_bytes; } deh_u; u_short deh_dnet; @@ -99,7 +99,7 @@ struct ddpehdr { u_char deh_snode; u_char deh_dport; u_char deh_sport; -}; +} __packed; #define deh_pad deh_u.du_bits.dub_pad #define deh_hops deh_u.du_bits.dub_hops #define deh_len deh_u.du_bits.dub_len @@ -123,10 +123,11 @@ struct ddpshdr { unsigned dub_len:10; unsigned dub_pad:6; #endif - } du_bits; + } __packed du_bits; unsigned du_bytes; } dsh_u; -}; +} __packed; + #define dsh_pad dsh_u.du_bits.dub_pad #define dsh_len dsh_u.du_bits.dub_len #define dsh_dport dsh_u.du_bits.dub_dport |