From 827145f01d849c663f18e356157fd71f1a7cc45d Mon Sep 17 00:00:00 2001 From: Linus Lüssing Date: Sun, 23 Aug 2015 17:19:26 +0200 Subject: bridge: Fix multicast_to_unicast feature by hairpin+isolate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All IGMP and MLD versions suffer from a specific limitation (from a snooping switch perspective): Report suppression. Once a listener hears an IGMPv2/3 or MLDv1 report for the same group itself participates in then it might (if this listener is an IGMPv3 or MLDv2 listener) or will (if this is an IGMPv1/2 or MLDv1 listener) refrain from sending its own report. Therefore we might currently miss such surpressing listeners as they won't receive the multicast packet with the mangled, unicasted destination. Fixing this by first isolating the STAs and giving the bridge more control over traffic forwarding. E.g. refraining to forward listener reports to other STAs. For broadcast and unicast traffic to an STA on the same AP, the hairpin feature of the bridge will reflect such traffic back to the AP interface. However, if the AP interface is actually configured to isolate STAs, then hairpin is kept disabled. Signed-off-by: Linus Lüssing --- scripts/netifd-wireless.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'scripts') diff --git a/scripts/netifd-wireless.sh b/scripts/netifd-wireless.sh index c5d8a96..f981f1b 100644 --- a/scripts/netifd-wireless.sh +++ b/scripts/netifd-wireless.sh @@ -248,12 +248,26 @@ wireless_vif_parse_encryption() { esac } +_wireless_set_brsnoop_isolation() { + local multicast_to_unicast="$1" + local isolate + + json_get_var isolate isolate + + [ $isolate -gt 0 -o -z "$network_bridge" ] && return + + [ -z "$multicast_to_unicast" ] && multicast_to_unicast=1 + [ $multicast_to_unicast -gt 0 ] && json_add_boolean isolate 1 +} + for_each_interface() { local _w_types="$1"; shift local _w_ifaces _w_iface local _w_type local _w_found + local multicast_to_unicast + json_get_keys _w_ifaces interfaces json_select interfaces for _w_iface in $_w_ifaces; do @@ -261,6 +275,7 @@ for_each_interface() { if [ -n "$_w_types" ]; then json_get_var network_bridge bridge json_select config + _wireless_set_brsnoop_isolation "$multicast_to_unicast" json_get_var _w_type mode json_select .. _w_types=" $_w_types " -- cgit v1.2.3