Ok in this email my proposal patch. I've to sleep 4s if you have an ap + adhoc vifs.
[ "$(echo $interface | awk '$0 ~ /^wlan[0-9]*/')" ] && sleep 4s
For convenience I sleep only if an wlan was triggered. If you have only one interface in adhoc mode per radio 3 seconds are enought.
bye
---------- Messaggio inoltrato ---------- Da: Marek Lindner lindner_marek@yahoo.de Date: 11 febbraio 2012 11:08 Oggetto: Re: /lib/batman-adv/config.sh A: Filippo Sallemi tonyputi@gmail.com
On Friday, February 10, 2012 01:21:21 you wrote:
Yeah - looks good. I still don't get why we don't need to wait 3/5 seconds anymore. Can you explain this ?
No i'm wrong we need to wait 3 seconds... i think that the sleep call could be moved to hotplug.d/99-batman-adv when an interface is added to mesh interface. I need some time.
Ok - I left the "sleep 3s" in the file. I applied your config_bat/bat_config as well as the forgotten ap_isolation config fix.
Since the for loop does not fix the wait problem why do you wish to change it? I am referring to your suggested change:
# Load network config here just in case! config_load network for iface in $interfaces; do # copy iface into ifname local ifname=$iface [ -f "/sys/class/net/$ifname/batman_adv/mesh_iface" ] || { # if ifname was not found try to find it via uci config config_get ifname $iface ifname [ -f "/sys/class/net/$ifname/batman_adv/mesh_iface" ] || continue }
[ "$ifname" = "$interface" ] && echo $mesh > /sys/class/net/$ifname/batman_adv/mesh_iface done
bat_add_interface() and bat_del_interface() have the same loop but we only change one ? The only difference I can see is another added variable and not calling "uci -q -P/var/state get network.$iface.ifname". Why ?
Cheers, Marek