From: Chester A. Unal Date: Tue, 5 May 2026 07:58:20 +0000 (+0100) Subject: bsbf-bonding: fix checking if interface is a bridge X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=ba55fc5cae15c1a7c03ed5957ddd1ef2ad2b899b;p=openwrt-packages.git bsbf-bonding: fix checking if interface is a bridge The current check would match a uci device section that doesn't say if the interface is a bridge. Check that the type option is bridge to address this. Signed-off-by: Chester A. Unal --- diff --git a/net/bsbf-openwrt-resources/files/etc/uci-defaults/99-bsbf-bonding b/net/bsbf-openwrt-resources/files/etc/uci-defaults/99-bsbf-bonding index 3bc706bef..8097b8b07 100644 --- a/net/bsbf-openwrt-resources/files/etc/uci-defaults/99-bsbf-bonding +++ b/net/bsbf-openwrt-resources/files/etc/uci-defaults/99-bsbf-bonding @@ -4,8 +4,10 @@ # Get the interface of lan network. lan_network_interface="$(uci -q get network.lan.device)" -# Check if lan is a bridge. -[ -n "$lan_network_interface" ] && lan_section=$(uci show network | grep "name='$lan_network_interface'" | cut -d. -f2) +# If the interface exists, check if it is a bridge. +[ -n "$lan_network_interface" ] && for section in $(uci show network | grep "name='$lan_network_interface'" | cut -d. -f2); do + [ "$(uci -q get network.$section.type)" = bridge ] && lan_section="$section" && break +done if [ -n "$lan_section" ]; then # Save all interfaces. lan_interfaces=$(uci get network.$lan_section.ports) @@ -24,8 +26,10 @@ fi # Get the interface of wan network. wan_network_interface="$(uci -q get network.wan.device)" -# Check if wan is a bridge. -[ -n "$wan_network_interface" ] && wan_section=$(uci show network | grep "name='$wan_network_interface'" | cut -d. -f2) +# If the interface exists, check if it is a bridge. +[ -n "$wan_network_interface" ] && for section in $(uci show network | grep "name='$wan_network_interface'" | cut -d. -f2); do + [ "$(uci -q get network.$section.type)" = bridge ] && wan_section="$section" && break +done if [ -n "$wan_section" ]; then # Save all interfaces. wan_network_interface="$(uci get network.$wan_section.ports)"