From dd55c60bd66942659e757d2bd08e8a6816966954 Mon Sep 17 00:00:00 2001 From: Rohit Topno Date: Mon, 22 Jan 2024 18:45:47 +0530 Subject: [PATCH] mcastmngr: fixed uci syntax error in init script Problem description: Multiple device section name fetched due to wild card grep command. Fix: modified grep command which gets exact device section name based on device name. --- mcastmngr/files/linux/lib/mcast/linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcastmngr/files/linux/lib/mcast/linux.sh b/mcastmngr/files/linux/lib/mcast/linux.sh index e3722f562..9af39da8d 100755 --- a/mcastmngr/files/linux/lib/mcast/linux.sh +++ b/mcastmngr/files/linux/lib/mcast/linux.sh @@ -15,7 +15,7 @@ snooping_bridges= __device_is_bridge() { local device="$2" - local devsec__="$(uci show network | grep name=.*$device | grep -v ifname | cut -d'.' -f2)" + local devsec__="$(uci show network | grep -F ".name='$device'" | cut -d'.' -f2)" local sectype="$(uci -q get network.$devsec__)" local devtype="$(uci -q get network.$devsec__.type)" [ "$sectype" != "device" -o "$devtype" != "bridge" ] && return 1