uci will return the bridge ports instead of the name of the bridge interface for
network.$iface.ifname when the bridge isn't up yet, causing the wrong interfaces
to be added to the mesh interface in addition to the bridge interface itself.

Signed-off-by: Matthias Schiffer <[email protected]>
---
 net/batman-adv/files/lib/batman-adv/config.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/batman-adv/files/lib/batman-adv/config.sh 
b/net/batman-adv/files/lib/batman-adv/config.sh
index 35d61ef..4db9945 100644
--- a/net/batman-adv/files/lib/batman-adv/config.sh
+++ b/net/batman-adv/files/lib/batman-adv/config.sh
@@ -52,6 +52,8 @@ bat_add_interface()
        config_get interfaces $mesh interfaces
        for iface in $interfaces; do
                [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || {
+                       config_get type $iface type
+                       [ "$type" = bridge -a "$(uci -q -P/var/state get 
network.$iface.up)" != 1 ] && continue
                        iface=$(uci -q -P/var/state get network.$iface.ifname)
                        [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || 
continue
                }
@@ -69,6 +71,8 @@ bat_del_interface()
        config_get interfaces $mesh interfaces
        for iface in $interfaces; do
                [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || {
+                       config_get type $iface type
+                       [ "$type" = bridge -a "$(uci -q -P/var/state get 
network.$iface.up)" != 1 ] && continue
                        iface=$(uci -q -P/var/state get network.$iface.ifname)
                        [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || 
continue
                }
-- 
1.7.11.4

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to