hi. why did you include that file twice? is there any reason to not do a
single include in the beginning of the the script?


2012/11/23 Gui Iribarren <[email protected]>

> 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 <[email protected]>
> ---
>
> ~/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
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
>



-- 
Jonh Wendell
http://www.bani.com.br
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to