aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2017-02-26 10:18:29 (GMT)
committerJouni Malinen <j@w1.fi>2017-02-26 10:18:29 (GMT)
commit4c8836f13985f2e3cfe26398de86065f8bcb3be3 (patch)
treec0c482be1c69061f18df978ca51039894ed8bdbc /src
parentc4bb39707fea93cee72d845007ceca800e653f00 (diff)
downloadhostap-4c8836f13985f2e3cfe26398de86065f8bcb3be3.zip
hostap-4c8836f13985f2e3cfe26398de86065f8bcb3be3.tar.gz
hostap-4c8836f13985f2e3cfe26398de86065f8bcb3be3.tar.bz2
FILS: Fix fils_hlp.c build with older netinet/udp.h definitions
The __FAVOR_BSD macro was previously used in netinet/udp.h to select between two different names of the variables in struct udphdr. Define that to force the versions with the uh_ prefix. In addition, use the same style consistently within fils_hlp.c. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src')
-rw-r--r--src/ap/fils_hlp.c4
-rw-r--r--src/common/dhcp.h6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/ap/fils_hlp.c b/src/ap/fils_hlp.c
index 40d9be1..3fc8721 100644
--- a/src/ap/fils_hlp.c
+++ b/src/ap/fils_hlp.c
@@ -269,8 +269,8 @@ static void fils_dhcp_handler(int sd, void *eloop_ctx, void *sock_ctx)
udph = wpabuf_put(resp, sizeof(*udph));
udph->uh_sport = htons(DHCP_SERVER_PORT);
udph->uh_dport = htons(DHCP_CLIENT_PORT);
- udph->len = htons(sizeof(*udph) + (end - pos));
- udph->check = htons(0x0000); /* TODO: calculate checksum */
+ udph->uh_ulen = htons(sizeof(*udph) + (end - pos));
+ udph->uh_sum = htons(0x0000); /* TODO: calculate checksum */
if (hapd->conf->dhcp_rapid_commit_proxy && msgtype == DHCPACK &&
!rapid_commit && sta->fils_dhcp_rapid_commit_proxy && end_opt) {
/* Add rapid commit option */
diff --git a/src/common/dhcp.h b/src/common/dhcp.h
index f2ef61e..e38512c 100644
--- a/src/common/dhcp.h
+++ b/src/common/dhcp.h
@@ -10,7 +10,13 @@
#define DHCP_H
#include <netinet/ip.h>
+#if __FAVOR_BSD
#include <netinet/udp.h>
+#else
+#define __FAVOR_BSD 1
+#include <netinet/udp.h>
+#undef __FAVOR_BSD
+#endif
#define DHCP_SERVER_PORT 67
#define DHCP_CLIENT_PORT 68