From a7fb5ea463f18a15f990b298e893cc7eeb180827 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 26 Nov 2014 01:05:24 +0200 Subject: [PATCH] proxyarp: Fix DHCP and ND message structures These need to be marked packed to avoid issues with compilers potentially adding padding between the fields (e.g., gcc on 64-bit seemed to make struct icmpv6_ndmsg two octets too long which broke IPv6 address discovery). Signed-off-by: Jouni Malinen --- src/ap/dhcp_snoop.c | 2 +- src/ap/ndisc_snoop.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ap/dhcp_snoop.c b/src/ap/dhcp_snoop.c index 703a59960..c5e37fb4f 100644 --- a/src/ap/dhcp_snoop.c +++ b/src/ap/dhcp_snoop.c @@ -36,7 +36,7 @@ struct bootp_pkt { u8 serv_name[64]; u8 boot_file[128]; u8 exten[312]; -}; +} STRUCT_PACKED; #define DHCPACK 5 static const u8 ic_bootp_cookie[] = { 99, 130, 83, 99 }; diff --git a/src/ap/ndisc_snoop.c b/src/ap/ndisc_snoop.c index b29cc70ed..755621c56 100644 --- a/src/ap/ndisc_snoop.c +++ b/src/ap/ndisc_snoop.c @@ -30,7 +30,7 @@ struct icmpv6_ndmsg { u8 opt_type; u8 len; u8 opt_lladdr[0]; -}; +} STRUCT_PACKED; #define ROUTER_ADVERTISEMENT 134 #define NEIGHBOR_SOLICITATION 135