In legacy ubnt2 devices, when trying to bring 3 VAPs, one in adhoc
mode managed with batman-adv, a race condition occurs and /var/state
doesn't get the .ifname updated quickly enough at boot time. Using
(the newer) ubus call infrastructure overcomes the race condition.

Signed-off-by: Gui Iribarren <g...@altermundi.net>
---

~/openwrt/trunk/feeds/packages$ svn diff net/batman-adv
Index: net/batman-adv/files/lib/batman-adv/config.sh
===================================================================
--- net/batman-adv/files/lib/batman-adv/config.sh       (revision 34303)
+++ net/batman-adv/files/lib/batman-adv/config.sh       (working copy)
@@ -44,6 +44,8 @@

 bat_add_interface()
 {
+       . /lib/functions/network.sh
+
        local mesh="$1"
        local interface="$2"
        local interfaces
@@ -52,7 +54,7 @@
        config_get interfaces $mesh interfaces
        for iface in $interfaces; do
                [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || {
-                       iface=$(uci -q -P/var/state get network.$iface.ifname)
+                       network_get_physdev iface $iface
                        [ -f
"/sys/class/net/$iface/batman_adv/mesh_iface" ] || continue
                }

@@ -62,6 +64,8 @@

 bat_del_interface()
 {
+       . /lib/functions/network.sh
+
        local mesh="$1"
        local interface="$2"
        local interfaces
@@ -69,7 +73,7 @@
        config_get interfaces $mesh interfaces
        for iface in $interfaces; do
                [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || {
-                       iface=$(uci -q -P/var/state get network.$iface.ifname)
+                       network_get_physdev iface $iface
                        [ -f
"/sys/class/net/$iface/batman_adv/mesh_iface" ] || continue
                }
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to