diff --git a/mcastmngr/files/linux/lib/mcast/linux.sh b/mcastmngr/files/linux/lib/mcast/linux.sh index 0a93dc141..57f4c5ecb 100755 --- a/mcastmngr/files/linux/lib/mcast/linux.sh +++ b/mcastmngr/files/linux/lib/mcast/linux.sh @@ -67,6 +67,22 @@ config_mcproxy_interfaces() { done } +config_sysfs_mcast_snooping() { + local devsec= + local sectype= + local devtype= + local ports= + + for downstream in $downstreams; do + devsec="$(uci show network | grep name=.*$downstream | cut -d'.' -f2)" + sectype="$(uci -q get network.$devsec)" + devtype="$(uci -q get network.$devsec.type)" + if [ "$sectype" == "device" -a "$devtype" == "bridge" ]; then + echo 1 > /sys/class/net/$downstream/bridge/multicast_snooping + fi + done +} + config_mcproxy_instance() { local protocol="$1" local version="$2" @@ -124,6 +140,10 @@ config_mcproxy_instance() { downstreams=$mld_p_down_interfaces fi + # for snooping to work we should enable it on the bridge, doing it from + # here instead of from inside network config + config_sysfs_mcast_snooping + [ -n "$robustness" ] && echo -e "rv $robustness;" >> $CONFFILE [ -n "$query_interval" ] && echo -e "qi $query_interval;" >> $CONFFILE [ -n "$q_resp_interval" ] && echo -e "qri $q_resp_interval;" >> $CONFFILE