Browse Source

AP: Enable multicast snooping on bridge if ProxyARP IPv6 is in use

This is needed to allow correct ProxyARP behavior for IPv6.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Jouni Malinen 10 years ago
parent
commit
60eb9e173e
3 changed files with 19 additions and 2 deletions
  1. 8 0
      src/ap/x_snoop.c
  2. 1 0
      src/drivers/driver.h
  3. 10 2
      src/drivers/driver_nl80211.c

+ 8 - 0
src/ap/x_snoop.c

@@ -51,6 +51,14 @@ int x_snoop_init(struct hostapd_data *hapd)
 		return -1;
 	}
 
+#ifdef CONFIG_IPV6
+	if (hostapd_drv_br_set_net_param(hapd, DRV_BR_MULTICAST_SNOOPING, 1)) {
+		wpa_printf(MSG_DEBUG,
+			   "x_snoop: Failed to enable multicast snooping on the bridge");
+		return -1;
+	}
+#endif /* CONFIG_IPV6 */
+
 	return 0;
 }
 

+ 1 - 0
src/drivers/driver.h

@@ -1577,6 +1577,7 @@ enum drv_br_port_attr {
 
 enum drv_br_net_param {
 	DRV_BR_NET_PARAM_GARP_ACCEPT,
+	DRV_BR_MULTICAST_SNOOPING,
 };
 
 struct drv_acs_params {

+ 10 - 2
src/drivers/driver_nl80211.c

@@ -8307,9 +8307,9 @@ static const char * drv_br_net_param_str(enum drv_br_net_param param)
 	switch (param) {
 	case DRV_BR_NET_PARAM_GARP_ACCEPT:
 		return "arp_accept";
+	default:
+		return NULL;
 	}
-
-	return NULL;
 }
 
 
@@ -8321,6 +8321,13 @@ static int wpa_driver_br_set_net_param(void *priv, enum drv_br_net_param param,
 	const char *param_txt;
 	int ip_version = 4;
 
+	if (param == DRV_BR_MULTICAST_SNOOPING) {
+		os_snprintf(path, sizeof(path),
+			    "/sys/devices/virtual/net/%s/bridge/multicast_snooping",
+			    bss->brname);
+		goto set_val;
+	}
+
 	param_txt = drv_br_net_param_str(param);
 	if (param_txt == NULL)
 		return -EINVAL;
@@ -8336,6 +8343,7 @@ static int wpa_driver_br_set_net_param(void *priv, enum drv_br_net_param param,
 	os_snprintf(path, sizeof(path), "/proc/sys/net/ipv%d/conf/%s/%s",
 		    ip_version, bss->brname, param_txt);
 
+set_val:
 	if (linux_write_system_file(path, val))
 		return -1;