]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
proxyarp: Fix compilation with Hotspot 2.0 disabled
authorDavid Bauer <mail@david-bauer.net>
Wed, 6 Oct 2021 00:21:05 +0000 (02:21 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 18 Oct 2021 18:24:59 +0000 (21:24 +0300)
The disable_dgaf config field is only available in case hostapd is
compiled with Hotspot 2.0 support (CONFIG_HS20=y), however Proxy-ARP
(CONFIG_PROXYARP=y) does not depend on Hotspot 2.0.

Only add the code related to this config field when Hotspot 2.0 is
enabled to fix compilation with the aformentioned preconditions.

Signed-off-by: David Bauer <mail@david-bauer.net>
src/ap/dhcp_snoop.c
src/ap/ndisc_snoop.c

index edc77da2e797da4c90feb6d37ea4524f0880f088..551936b8e43ca70543d2fe8e84f3bf48268646c1 100644 (file)
@@ -88,6 +88,7 @@ static void handle_dhcp(void *ctx, const u8 *src_addr, const u8 *buf,
                }
        }
 
+#ifdef CONFIG_HS20
        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))
@@ -96,6 +97,7 @@ static void handle_dhcp(void *ctx, const u8 *src_addr, const u8 *buf,
                                                            (u8 *) buf, len);
                }
        }
+#endif /* CONFIG_HS20 */
 
        if (msgtype == DHCPACK) {
                if (b->your_ip == 0)
index 4d6a92e086bd593858d44ef4a37075cedb99220f..788c12fdc1cfa083ac9be3ac4c8ce3f49c84b81f 100644 (file)
@@ -150,10 +150,12 @@ static void handle_ndisc(void *ctx, const u8 *src_addr, const u8 *buf,
                                return;
                }
                break;
+#ifdef CONFIG_HS20
        case ROUTER_ADVERTISEMENT:
                if (hapd->conf->disable_dgaf)
                        ucast_to_stas(hapd, buf, len);
                break;
+#endif /* CONFIG_HS20 */
        case NEIGHBOR_ADVERTISEMENT:
                if (hapd->conf->na_mcast_to_ucast)
                        ucast_to_stas(hapd, buf, len);