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
oopps. I've miss the files
Il 26 febbraio 2012 18:49, Filippo Sallemi tonyputi@gmail.com ha scritto:
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
-- Filippo Sallemi
On Monday, February 27, 2012 01:49:44 Filippo Sallemi wrote:
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.
What if somebody calls his interfaces in a different way ? As you know the name can freely be chosen.
Regards, Marek
Il 27 febbraio 2012 09:11, Marek Lindner lindner_marek@yahoo.de ha scritto:
On Monday, February 27, 2012 01:49:44 Filippo Sallemi wrote:
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.
What if somebody calls his interfaces in a different way ? As you know the name can freely be chosen.
You can chose another name instead of wlan0 wlan0-1 wlan1 wlan1-1 eth0 eth1 ...? This line is executed only when hotplug is called on network restart and so when every interface is triggered. when eth0 is added we don't sleep but when if wlan0 is triggered then we sleep 4 seconds because the real state of the interface and so the real name of your logical network take some time to be ready.
Regards, Marek
Rgds
On Monday, February 27, 2012 20:42:58 Filippo Sallemi wrote:
Il 27 febbraio 2012 09:11, Marek Lindner lindner_marek@yahoo.de ha
scritto:
On Monday, February 27, 2012 01:49:44 Filippo Sallemi wrote:
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.
What if somebody calls his interfaces in a different way ? As you know the name can freely be chosen.
You can chose another name instead of wlan0 wlan0-1 wlan1 wlan1-1 eth0 eth1 ...?
Yes, you can. I thought you were doing it to after I saw your config:
config 'mesh' 'mesh' option 'interfaces' 'msh0'
msh0 does not look like wlanX at all, wouldn't you say so ?
Cheers, Marek
Ok but i' dont wait for this. Hotplug was called when a new interface is added. msh0 is no a real interface so when wlan0 is added I sleep 4 seconds and check if wlan0 is part o batman-adv interfaces.
Rgds
Il 28 febbraio 2012 06:44, Marek Lindner lindner_marek@yahoo.de ha scritto:
On Monday, February 27, 2012 20:42:58 Filippo Sallemi wrote:
Il 27 febbraio 2012 09:11, Marek Lindner lindner_marek@yahoo.de ha
scritto:
On Monday, February 27, 2012 01:49:44 Filippo Sallemi wrote:
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.
What if somebody calls his interfaces in a different way ? As you know the name can freely be chosen.
You can chose another name instead of wlan0 wlan0-1 wlan1 wlan1-1 eth0 eth1 ...?
Yes, you can. I thought you were doing it to after I saw your config:
config 'mesh' 'mesh' option 'interfaces' 'msh0'
msh0 does not look like wlanX at all, wouldn't you say so ?
Cheers, Marek
On Tuesday, February 28, 2012 16:06:44 Filippo Sallemi wrote:
Ok but i' dont wait for this. Hotplug was called when a new interface is added. msh0 is no a real interface so when wlan0 is added I sleep 4 seconds and check if wlan0 is part o batman-adv interfaces.
Sorry, I don't understand. What do you mean with "msh0" is not a real interface ? The part about wlan0 I understand - the question was what happens if the interface is not named wlan0?
This could be your wireless config file: config 'wifi-iface' option 'device' 'radio0' option 'ifname' 'msh0' option 'mode' 'adhoc' option 'ssid' 'mesh'
Cheers, Marek
Il 28 febbraio 2012 09:21, Marek Lindner lindner_marek@yahoo.de ha scritto:
On Tuesday, February 28, 2012 16:06:44 Filippo Sallemi wrote:
Ok but i' dont wait for this. Hotplug was called when a new interface is added. msh0 is no a real interface so when wlan0 is added I sleep 4 seconds and check if wlan0 is part o batman-adv interfaces.
Sorry, I don't understand. What do you mean with "msh0" is not a real interface ?
That msh0 is the name of logical network and wlan0 is the real name of physical interface. The part about wlan0 I understand - the question was what happens
if the interface is not named wlan0?
yes. if in your batman-adv interface you put wlan0 (the real interface name) you don't have to sleep. The problem is that hotplug.d, when a new interface was added, at 99-batman-adv script time it try to check if the new interface (es. wlan0) is part of batman-adv interface definitions so now if in your batman-adv config file you have msh0, the script try to find the real interface name of msh0 and it fail because it is not be knowned at this time. The only way to get it to work properly is to wait for some seconds (3 seconds if you have only one vif, 4 for 2 interface es adhoc + ap).
This could be your wireless config file: config 'wifi-iface' option 'device' 'radio0' option 'ifname' 'msh0' option 'mode' 'adhoc' option 'ssid' 'mesh'
Cheers, Marek
Bye
b.a.t.m.a.n@lists.open-mesh.org