batman openwrt

Message ID 201203050315.23089.lindner_marek@yahoo.de (mailing list archive)
State RFC, archived
Headers

Commit Message

Marek Lindner March 4, 2012, 7:15 p.m. UTC
  On Sunday, February 12, 2012 13:50:21 Marek Lindner wrote:
> On Saturday, February 11, 2012 08:36:22 Gioacchino Mazzurco wrote:
> > After upgrading to latest batman version on openwt batman stopped adding
> > ethernet or bridge interfaces at start...
> > 
> > it add only wireless interfaces
> 
> Last night we got to the bottom of this. The new hotplug based system is at
> the core of the issue: The Ethernet driver on the device is compiled into
> the kernel, thus loaded before the batman-adv kernel module is loaded. As
> a result the "interface add" event is triggered before batman-adv is
> active and the device can't be added to the batman-adv mesh.

Attached to this mail you'll find a patch for the hotplug scripts. Jow 
suggested to simply load the kernel module when it is not loaded. Could you 
test the patch and let me know whether it fixes your problem ?

Regards,
Marek
  

Patch

--- a/batman-adv/files/lib/batman-adv/config.sh	(revision 30804)
+++ b/batman-adv/files/lib/batman-adv/config.sh	(working copy)
@@ -1,6 +1,15 @@ 
 #!/bin/sh
 
-bat_config(){
+bat_load_module()
+{
+	[ -d "/sys/module/batman_adv/" ] && return
+	
+	. /etc/functions.sh
+	load_modules /etc/modules.d/*-lib-crc16 /etc/modules.d/*-batman-adv	
+}
+
+bat_config()
+{
 	local mesh="$1"
 	local aggregated_ogms bonding fragmentation gw_bandwidth gw_mode gw_sel_class log_level orig_interval hop_penalty vis_mode
 
@@ -30,7 +39,8 @@ 
 	
 }
 
-bat_add_interface(){
+bat_add_interface()
+{
 	local mesh="$1"
 	local interface="$2"
 	local interfaces
@@ -47,7 +57,8 @@ 
 	done
 }
 
-bat_del_interface(){
+bat_del_interface()
+{
 	local mesh="$1"
 	local interface="$2"
 	local interfaces
--- a/batman-adv/files/usr/sbin/batman-adv	(revision 30804)
+++ b/batman-adv/files/usr/sbin/batman-adv	(working copy)
@@ -26,6 +26,7 @@ 
 
 # can also be used with "batman-adv start bat0"
 start() {
+	bat_load_module
 	config_load batman-adv
 
 	if [ -n "$1" ]; then
--- a/batman-adv/files/etc/hotplug.d/net/99-batman-adv	(revision 30804)
+++ b/batman-adv/files/etc/hotplug.d/net/99-batman-adv	(working copy)
@@ -2,6 +2,7 @@ 
 
 . /lib/batman-adv/config.sh
 
+bat_load_module
 config_load batman-adv
 
 case "$ACTION" in