[commits] [batman-adv] next: batman-adv: Fix build of batman-adv without BLA (cca9d02)

postmaster at open-mesh.org postmaster at open-mesh.org
Thu Oct 18 12:02:46 CEST 2012


Repository : ssh://git@open-mesh.org/batman-adv

On branch  : next

>---------------------------------------------------------------

commit cca9d02f8df36a8273e8059e59c4cc0354a41be5
Author: Sven Eckelmann <sven at narfation.org>
Date:   Thu Oct 18 10:48:32 2012 +0200

    batman-adv: Fix build of batman-adv without BLA
    
    4c1721b39c8a77c99e8f4de97b5d5d112006406c ("batman-adv: Fix potential broadcast
    BLA-duplicate-check race condition") introduced a spinlock for bridge loop
    avoidance which was initialized outside of bla. This causes an build error when
    BLA is disabled. Instead the batadv_bla_init function should handle the
    initialization.
    
    Signed-off-by: Sven Eckelmann <sven at narfation.org>
    Signed-off-by: Marek Lindner <lindner_marek at yahoo.de>


>---------------------------------------------------------------

cca9d02f8df36a8273e8059e59c4cc0354a41be5
 bridge_loop_avoidance.c |    2 ++
 main.c                  |    1 -
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index 1f5ee77..fd8d5af 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -1167,6 +1167,8 @@ int batadv_bla_init(struct batadv_priv *bat_priv)
 	uint16_t crc;
 	unsigned long entrytime;
 
+	spin_lock_init(&bat_priv->bla.bcast_duplist_lock);
+
 	batadv_dbg(BATADV_DBG_BLA, bat_priv, "bla hash registering\n");
 
 	/* setting claim destination address */
diff --git a/main.c b/main.c
index f167b65..b4aa470 100644
--- a/main.c
+++ b/main.c
@@ -101,7 +101,6 @@ int batadv_mesh_init(struct net_device *soft_iface)
 	spin_lock_init(&bat_priv->gw.list_lock);
 	spin_lock_init(&bat_priv->vis.hash_lock);
 	spin_lock_init(&bat_priv->vis.list_lock);
-	spin_lock_init(&bat_priv->bla.bcast_duplist_lock);
 
 	INIT_HLIST_HEAD(&bat_priv->forw_bat_list);
 	INIT_HLIST_HEAD(&bat_priv->forw_bcast_list);



More information about the commits mailing list