Browse Source

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 <jouni@qca.qualcomm.com>
Jouni Malinen 10 years ago
parent
commit
a7fb5ea463
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/ap/dhcp_snoop.c
  2. 1 1
      src/ap/ndisc_snoop.c

+ 1 - 1
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 };

+ 1 - 1
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