diff --git a/mcastmngr/files/common/etc/uci-defaults/61-mcast_config_generate b/mcastmngr/files/common/etc/uci-defaults/61-mcast_config_generate index 3c8c14824..089c5f230 100644 --- a/mcastmngr/files/common/etc/uci-defaults/61-mcast_config_generate +++ b/mcastmngr/files/common/etc/uci-defaults/61-mcast_config_generate @@ -89,15 +89,24 @@ interfaces_ok(){ # check if upstream untagged IFS=" " for itf in $up_interf; do - # check if there exist a device section for this upstream interface, if yes the - # do nothing, if no then split the it at . and use the native interface as - # upstream interface - dev_section=$(ubus call uci get '{"config":"network", "type":"device", "match":{"name":"'"$itf"'"}}' | jsonfilter -e @.values | jq keys[]) + # check if there exist a interface section for this upstream interface, if yes the + # do nothing, if no then generate config as mcast config is outdated + local dev_section=$(uci show network | grep -E "\.device=\'$itf\'" | cut -d'.' -f2) # mcast config is outdated, simply generate as per new logic if [ -z "$dev_section" ]; then # check if the itf is a native interface && return 1 - [ -f "/proc/net/vlan/$itf" ] || return 1 + return 1 + else + section_type=$(uci get network.$dev_section) + if [ "$section_type" == "interface" ]; then + # interface section exits, hence, sync has already happened + # nothing to do further, just return + return 0 + else + # mcast config is outdated + return 1 + fi fi done return 0