From c0f7c0ecf1bab70ed5fcdfa8466c41872b329b97 Mon Sep 17 00:00:00 2001 From: Rahul Date: Fri, 17 Jul 2020 12:18:28 +0530 Subject: [PATCH] mcastmngr: handle mcast config for ifup in snooping The handling of ifup event in case of snooping config was missing. Note: ifup event is generated only for l3 interface, so, say ethx is member of br-y which has proto none. In this case if ethx link goes down and comes up again, IPTV will not work without a mcast reload. From the look of it this will be the case in old version as well and at the moment I don't know how this can be handled but considering this is a remote scenario in my opinion I don't think the risk is too high. I would continue to look for a solution ofcourse. --- .../files/etc/hotplug.d/iface/mcast.hotplug | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/mcastmngr/files/etc/hotplug.d/iface/mcast.hotplug b/mcastmngr/files/etc/hotplug.d/iface/mcast.hotplug index c1fab37da..4345c949b 100644 --- a/mcastmngr/files/etc/hotplug.d/iface/mcast.hotplug +++ b/mcastmngr/files/etc/hotplug.d/iface/mcast.hotplug @@ -10,16 +10,22 @@ network_get_device l3device $INTERFACE compare_mcast_proxy_upstream() { local upstream + local mode="$2" - config_get upstream $1 upstream_interface + if [ "$mode" == "proxy" ]; then + config_get upstream $1 upstream_interface + else + config_get upstream $1 interface + fi - for dev in $upstream; do - if [ "$l3device" == "$dev" ]; then - ubus call uci commit '{"config":"mcast"}' - exit - fi - done + for dev in $upstream; do + if [ "$l3device" == "$dev" ]; then + ubus call uci commit '{"config":"mcast"}' + exit + fi + done } config_load mcast -config_foreach compare_mcast_proxy_upstream "proxy" +config_foreach compare_mcast_proxy_upstream "proxy" "proxy" +config_foreach compare_mcast_proxy_upstream "snooping" "snooping"