mcastmngr: fix mld filtering

This commit is contained in:
Rahul Thakur 2024-12-24 14:03:08 +05:30
parent c41ed55d5f
commit bc4bb6b9ea
2 changed files with 12 additions and 4 deletions

View file

@ -29,7 +29,8 @@ MAKE_PATH:=bbf_plugin
define Package/mcastmngr
CATEGORY:=Utilities
TITLE:=Multicast Proxy/Snooping Manager
DEPENDS:=+!TARGET_brcmbca:mcproxy +libuci +libubox +libubus +libblobmsg-json
DEPENDS:=+libuci +libubox +libubus +libblobmsg-json
DEPENDS+=+!TARGET_brcmbca:mcproxy +!TARGET_brcmbca:sipcalc
DEPENDS+=+libbbfdm-api +libbbfdm-ubus +dm-service
endef

View file

@ -89,9 +89,16 @@ config_mcproxy_interfaces() {
for excp in $exceptions; do
case $excp in
*/*)
if [ "$protocol" == "igmp" ]; then
ip_start="$(ipcalc.sh $excp | grep IP | awk '{print substr($0,4)}')"
ip_end="$(ipcalc.sh $excp | grep BROADCAST | awk '{print substr($0,11)}')"
filter="$filter ($ip_start - $ip_end | *)"
elif [ "$protocol" == "mld" ]; then
output="$(sipcalc $excp | grep "Network range" -A 1 | cut -d'-' -f2 | tr '\n' ' ')"
ip_start="$(echo $output | awk '{print $1}')"
ip_end="$(echo $output | awk '{print $2}')"
filter="$filter ($ip_start - $ip_end | *)"
fi
;;
*)
filter="$filter ($excp | *)"