Repository : ssh://git@open-mesh.org/openwrt-feed-batman-adv
On branch : master
commit 58875db4e6984bcd9866e568bc45f1dc01155687 Author: Marek Lindner lindner_marek@yahoo.de Date: Mon Nov 26 18:49:17 2012 +0800
batman-adv-devel: fix race condition between iface add and iface up
Signed-off-by: Gui Iribarren gui@altermundi.net Signed-off-by: Marek Lindner lindner_marek@yahoo.de
58875db4e6984bcd9866e568bc45f1dc01155687 batman-adv-devel/Makefile | 3 ++- batman-adv-devel/files/etc/hotplug.d/iface/99-batman-adv | 12 ++++++++++++ batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv | 1 - batman-adv-devel/files/lib/batman-adv/config.sh | 1 - 4 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile index c57c327..e80b49a 100644 --- a/batman-adv-devel/Makefile +++ b/batman-adv-devel/Makefile @@ -113,10 +113,11 @@ define Build/Clean endef
define KernelPackage/batman-adv-devel/install - $(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/net $(1)/lib/batman-adv $(1)/usr/sbin + $(INSTALL_DIR) $(1)/etc/config $(1)/etc/hotplug.d/net $(1)/etc/hotplug.d/iface $(1)/lib/batman-adv $(1)/usr/sbin $(INSTALL_DATA) ./files/etc/config/batman-adv $(1)/etc/config $(INSTALL_DATA) ./files/lib/batman-adv/config.sh $(1)/lib/batman-adv $(INSTALL_BIN) ./files/etc/hotplug.d/net/99-batman-adv $(1)/etc/hotplug.d/net + $(INSTALL_BIN) ./files/etc/hotplug.d/iface/99-batman-adv $(1)/etc/hotplug.d/iface $(INSTALL_BIN) ./files/usr/sbin/batman-adv $(1)/usr/sbin $(BATCTL_INSTALL) endef diff --git a/batman-adv-devel/files/etc/hotplug.d/iface/99-batman-adv b/batman-adv-devel/files/etc/hotplug.d/iface/99-batman-adv new file mode 100644 index 0000000..9206c42 --- /dev/null +++ b/batman-adv-devel/files/etc/hotplug.d/iface/99-batman-adv @@ -0,0 +1,12 @@ +#!/bin/sh + +. /lib/batman-adv/config.sh + +bat_load_module +config_load batman-adv + +case "$ACTION" in + ifup) + [ -d /sys/class/net/$DEVICE/batman_adv/ ] && config_foreach bat_add_interface mesh "$DEVICE" + ;; +esac diff --git a/batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv b/batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv index 42d4c29..47132c1 100644 --- a/batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv +++ b/batman-adv-devel/files/etc/hotplug.d/net/99-batman-adv @@ -8,7 +8,6 @@ config_load batman-adv case "$ACTION" in add) [ -d /sys/class/net/$INTERFACE/mesh/ ] && bat_config "$INTERFACE" - [ -d /sys/class/net/$INTERFACE/batman_adv/ ] && config_foreach bat_add_interface mesh "$INTERFACE" ;; remove) [ -d /sys/class/net/$INTERFACE/batman_adv/ ] && config_foreach bat_del_interface mesh "$INTERFACE" diff --git a/batman-adv-devel/files/lib/batman-adv/config.sh b/batman-adv-devel/files/lib/batman-adv/config.sh index 0917462..5260c01 100644 --- a/batman-adv-devel/files/lib/batman-adv/config.sh +++ b/batman-adv-devel/files/lib/batman-adv/config.sh @@ -51,7 +51,6 @@ bat_add_interface() local interface="$2" local interfaces
- sleep 3s # some device (ath) is very lazy to start config_get interfaces $mesh interfaces for iface in $interfaces; do [ -f "/sys/class/net/$iface/batman_adv/mesh_iface" ] || {