657ef5f2ed71b7914f659fbd3cfd98f22e7a2d08
[openwrt/staging/ansuel.git] /
1 From ad694836b2ded6b97b426bf331627537cdbff591 Mon Sep 17 00:00:00 2001
2 From: David Bauer <mail@david-bauer.net>
3 Date: Thu, 19 Aug 2021 00:52:04 +0200
4 Subject: [PATCH] proxyarp: fix compilation with Hotspot 2.0 disabled
5
6 The disable_dgaf config fiels is only available in case Hostapd is
7 compiled with Hotspot 2.0 support, however Proxy-ARP does not depend on
8 Hotspot 2.0.
9
10 Only add the code related to this config field when Hotspot 2.0 is
11 enabled to fix compilation with the aformentioned preconditions.
12
13 Signed-off-by: David Bauer <mail@david-bauer.net>
14 ---
15 src/ap/dhcp_snoop.c | 2 ++
16 src/ap/ndisc_snoop.c | 2 ++
17 2 files changed, 4 insertions(+)
18
19 --- a/src/ap/dhcp_snoop.c
20 +++ b/src/ap/dhcp_snoop.c
21 @@ -88,6 +88,7 @@ static void handle_dhcp(void *ctx, const
22 }
23 }
24
25 +#ifdef CONFIG_HS20
26 if (hapd->conf->disable_dgaf && is_broadcast_ether_addr(buf)) {
27 for (sta = hapd->sta_list; sta; sta = sta->next) {
28 if (!(sta->flags & WLAN_STA_AUTHORIZED))
29 @@ -96,6 +97,7 @@ static void handle_dhcp(void *ctx, const
30 (u8 *) buf, len);
31 }
32 }
33 +#endif
34
35 if (msgtype == DHCPACK) {
36 if (b->your_ip == 0)
37 --- a/src/ap/ndisc_snoop.c
38 +++ b/src/ap/ndisc_snoop.c
39 @@ -151,10 +151,12 @@ static void handle_ndisc(void *ctx, cons
40 return;
41 }
42 break;
43 +#ifdef CONFIG_HS20
44 case ROUTER_ADVERTISEMENT:
45 if (hapd->conf->disable_dgaf)
46 ucast_to_stas(hapd, buf, len);
47 break;
48 +#endif
49 case NEIGHBOR_ADVERTISEMENT:
50 if (hapd->conf->na_mcast_to_ucast)
51 ucast_to_stas(hapd, buf, len);