Add support for HS20 and fix disable_dgaf bug in hostapd
[lede.git] / package / network / services / hostapd / files / 800-hostapd_disable_dgaf_multicast_fix.patch
1 --- a/src/ap/dhcp_snoop.c
2 +++ b/src/ap/dhcp_snoop.c
3 @@ -110,6 +110,15 @@ static void handle_dhcp(void *ctx, const u8 *src_addr, const u8 *buf,
4                 }
5         }
6  
7 +       if (hapd->conf->disable_dgaf && is_broadcast_ether_addr(buf)) {
8 +               for (sta = hapd->sta_list; sta; sta = sta->next) {
9 +                       if (!(sta->flags & WLAN_STA_AUTHORIZED))
10 +                               continue;
11 +                       x_snoop_mcast_to_ucast_convert_send(hapd, sta,
12 +                                                           (u8 *) buf, len);
13 +               }
14 +       }
15 +
16         if (msgtype == DHCPACK) {
17                 if (b->your_ip == 0)
18                         return;
19 @@ -146,15 +155,6 @@ static void handle_dhcp(void *ctx, const u8 *src_addr, const u8 *buf,
20                 }
21                 sta->ipaddr = b->your_ip;
22         }
23 -
24 -       if (hapd->conf->disable_dgaf && is_broadcast_ether_addr(buf)) {
25 -               for (sta = hapd->sta_list; sta; sta = sta->next) {
26 -                       if (!(sta->flags & WLAN_STA_AUTHORIZED))
27 -                               continue;
28 -                       x_snoop_mcast_to_ucast_convert_send(hapd, sta,
29 -                                                           (u8 *) buf, len);
30 -               }
31 -       }
32  }
33  
34