]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make IPv6 NA multicast-to-unicast conversion configurable
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 27 Apr 2015 09:30:09 +0000 (12:30 +0300)
committerJouni Malinen <j@w1.fi>
Mon, 27 Apr 2015 09:30:09 +0000 (12:30 +0300)
This can be used with Proxy ARP to allow multicast NAs to be forwarded
to associated STAs using link layer unicast delivery. This used to be
hardcoded to be enabled, but it is now disabled by default and can be
enabled with na_mcast_to_ucast=1. This functionality may not be desired
in all networks and most cases work without it, so the new
default-to-disabled is more appropriate.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
hostapd/config_file.c
hostapd/hostapd.conf
src/ap/ap_config.h
src/ap/ndisc_snoop.c

index 11866445bd4b78f1734e2917a9bdbddcedde61be..4976966e2d8285b4fcc78b6f0c0846e8c0cc95b7 100644 (file)
@@ -3138,6 +3138,8 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                bss->disable_dgaf = atoi(pos);
        } else if (os_strcmp(buf, "proxy_arp") == 0) {
                bss->proxy_arp = atoi(pos);
+       } else if (os_strcmp(buf, "na_mcast_to_ucast") == 0) {
+               bss->na_mcast_to_ucast = atoi(pos);
        } else if (os_strcmp(buf, "osen") == 0) {
                bss->osen = atoi(pos);
        } else if (os_strcmp(buf, "anqp_domain_id") == 0) {
index 90d15232b70df5ce2788b10f76d03e3ce300397a..b4754b360f2c703f9518cd769fd63d4404184a1b 100644 (file)
@@ -1493,6 +1493,13 @@ own_ip_addr=127.0.0.1
 # 1 = enabled
 #proxy_arp=1
 
+# IPv6 Neighbor Advertisement multicast-to-unicast conversion
+# This can be used with Proxy ARP to allow multicast NAs to be forwarded to
+# associated STAs using link layer unicast delivery.
+# 0 = disabled (default)
+# 1 = enabled
+#na_mcast_to_ucast=0
+
 ##### IEEE 802.11u-2011 #######################################################
 
 # Enable Interworking service
index 7b4a7eaa2606f9540bead87d032e708f1ad63e1c..c3573a480244395892bc25120b67109feeb4acd4 100644 (file)
@@ -490,6 +490,7 @@ struct hostapd_bss_config {
 
        int osen;
        int proxy_arp;
+       int na_mcast_to_ucast;
 #ifdef CONFIG_HS20
        int hs20;
        int disable_dgaf;
index b0d42dcd82c4912b63c9ccc1e35f659d38176105..0adcc97d702a084f9b4d52cac3fd849acec33437 100644 (file)
@@ -81,6 +81,18 @@ static int sta_has_ip6addr(struct sta_info *sta, struct in6_addr *addr)
 }
 
 
+static void ucast_to_stas(struct hostapd_data *hapd, const u8 *buf, size_t len)
+{
+       struct sta_info *sta;
+
+       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);
+       }
+}
+
+
 static void handle_ndisc(void *ctx, const u8 *src_addr, const u8 *buf,
                         size_t len)
 {
@@ -133,16 +145,12 @@ static void handle_ndisc(void *ctx, const u8 *src_addr, const u8 *buf,
                }
                break;
        case ROUTER_ADVERTISEMENT:
-               if (!hapd->conf->disable_dgaf)
-                       return;
-               /* fall through */
+               if (hapd->conf->disable_dgaf)
+                       ucast_to_stas(hapd, buf, len);
+               break;
        case NEIGHBOR_ADVERTISEMENT:
-               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 (hapd->conf->na_mcast_to_ucast)
+                       ucast_to_stas(hapd, buf, len);
                break;
        default:
                break;