diff mbox

[OpenWrt-Devel,PATCHv2,1/3] hostapd: Always isolate if brport->multicast_to_unicast is enabled

Message ID 1438729208-3556-5-git-send-email-linus.luessing@c0d3.blue
State Changes Requested
Headers show

Commit Message

Linus Lüssing Aug. 4, 2015, 11 p.m. UTC
For the multicast-to-unicast feature of a bridge to function correctly,
it is necessary that all STAs are always isolated on the AP level. The
bridge will take care of reflecting packets back to the AP interface
if necessary and/or no STA isolation wanted by using the hairpin feature
of the bridge.

Signed-off-by: Linus Lüssing <linus.luessing@c0d3.blue>
---
 package/network/services/hostapd/files/netifd.sh |    9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox

Patch

diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index a3ffd93..b987a63 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -1,3 +1,6 @@ 
+. /lib/network/config.sh
+. /lib/config/uci.sh
+
 wpa_supplicant_add_rate() {
 	local var="$1"
 	local val="$(($2 / 1000))"
@@ -194,9 +197,15 @@  hostapd_set_bss_options() {
 	set_default uapsd 1
 
 	append bss_conf "ctrl_interface=/var/run/hostapd"
+
+	[ -n "$multicast_to_unicast" ] || multicast_to_unicast=1
+
 	if [ "$isolate" -gt 0 ]; then
 		append bss_conf "ap_isolate=$isolate" "$N"
+	elif [ -n "$network_bridge" -a $multicast_to_unicast -gt 0 ]; then
+		append bss_conf "ap_isolate=1" "$N"
 	fi
+
 	if [ "$maxassoc" -gt 0 ]; then
 		append bss_conf "max_num_sta=$maxassoc" "$N"
 	fi