aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2018-12-29 23:05:18 (GMT)
committerJouni Malinen <j@w1.fi>2018-12-29 23:05:18 (GMT)
commitb98933eafcbea8a0dd01806591a497904b64b5f0 (patch)
treeefe5819b6a0bb94ca3ac9c45df3771058a1a8b42
parent0456b7d312c7a77d2513c0a0fc9d23e91a5edb27 (diff)
downloadhostap-b98933eafcbea8a0dd01806591a497904b64b5f0.zip
hostap-b98933eafcbea8a0dd01806591a497904b64b5f0.tar.gz
hostap-b98933eafcbea8a0dd01806591a497904b64b5f0.tar.bz2
HS 2.0: DHCP broadcast-to-unicast conversion before address learning
handle_dhcp() was first trying to learn the IP address of an associated STA before doing broadcast-to-unicast conversion. This could result in not converting some DHCPACK messages since the address learning part aborts processing by returning from the function in various cases. Reorder these operations to allow broadcast-to-unicast conversion to happen even if an associated STA entry is not updated based on a DHCPACK. Signed-off-by: Jouni Malinen <j@w1.fi>
-rw-r--r--src/ap/dhcp_snoop.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ap/dhcp_snoop.c b/src/ap/dhcp_snoop.c
index 6d8c2f4..ed37fc8 100644
--- a/src/ap/dhcp_snoop.c
+++ b/src/ap/dhcp_snoop.c
@@ -88,6 +88,15 @@ static void handle_dhcp(void *ctx, const u8 *src_addr, const u8 *buf,
}
}
+ if (hapd->conf->disable_dgaf && is_broadcast_ether_addr(buf)) {
+ for (sta = hapd->sta_list; sta; sta = sta->next) {
+ if (!(sta->flags & WLAN_STA_AUTHORIZED))
+ continue;
+ x_snoop_mcast_to_ucast_convert_send(hapd, sta,
+ (u8 *) buf, len);
+ }
+ }
+
if (msgtype == DHCPACK) {
if (b->your_ip == 0)
return;
@@ -124,15 +133,6 @@ static void handle_dhcp(void *ctx, const u8 *src_addr, const u8 *buf,
}
sta->ipaddr = b->your_ip;
}
-
- if (hapd->conf->disable_dgaf && is_broadcast_ether_addr(buf)) {
- for (sta = hapd->sta_list; sta; sta = sta->next) {
- if (!(sta->flags & WLAN_STA_AUTHORIZED))
- continue;
- x_snoop_mcast_to_ucast_convert_send(hapd, sta,
- (u8 *) buf, len);
- }
- }
}