]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
FILS: Fix fils_hlp.c build with older netinet/udp.h definitions
authorJouni Malinen <jouni@qca.qualcomm.com>
Sun, 26 Feb 2017 10:18:29 +0000 (12:18 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 26 Feb 2017 10:18:29 +0000 (12:18 +0200)
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>
src/ap/fils_hlp.c
src/common/dhcp.h

index 40d9be145e3ab8a9e8d3926cab78294fbe75eafc..3fc872139f0e26d5e20c5b435417f7030dea5bf7 100644 (file)
@@ -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 */
index f2ef61ecaf80c8356882813ede455c9a3df2d4ef..e38512c24d9f8d06c487e257080432c41a8228da 100644 (file)
 #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