[linux-next] LinuxNextTracking branch, master, updated. next-20120807

batman at open-mesh.org batman at open-mesh.org
Wed Aug 8 00:15:53 CEST 2012


The following commit has been merged in the master branch:
commit caa0bf648cd20a2efbb6558531711e9ce2c6e948
Author: Marek Lindner <lindner_marek at yahoo.de>
Date:   Sat Aug 4 04:13:26 2012 +0000

    batman-adv: select an internet gateway if none was chosen
    
    This is a regression introduced by: 2265c141086474bbae55a5bb3afa1ebb78ccaa7c
    ("batman-adv: gateway election code refactoring")
    
    Reported-by: Nicolás Echániz <nicoechaniz at codigosur.org>
    Signed-off-by: Marek Lindner <lindner_marek at yahoo.de>
    Acked-by: Antonio Quartulli <ordex at autistici.org>
    Signed-off-by: Antonio Quartulli <ordex at autistici.org>
    Signed-off-by: David S. Miller <davem at davemloft.net>

diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index b421cc4..fc866f2 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -200,11 +200,11 @@ void batadv_gw_election(struct batadv_priv *bat_priv)
 	if (atomic_read(&bat_priv->gw_mode) != BATADV_GW_MODE_CLIENT)
 		goto out;
 
-	if (!batadv_atomic_dec_not_zero(&bat_priv->gw_reselect))
-		goto out;
-
 	curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
 
+	if (!batadv_atomic_dec_not_zero(&bat_priv->gw_reselect) && curr_gw)
+		goto out;
+
 	next_gw = batadv_gw_get_best_gw_node(bat_priv);
 
 	if (curr_gw == next_gw)

-- 
LinuxNextTracking


More information about the linux-merge mailing list