]> Git Repo - linux.git/commitdiff
batman-adv: select an internet gateway if none was chosen
authorMarek Lindner <[email protected]>
Sat, 4 Aug 2012 04:13:26 +0000 (04:13 +0000)
committerDavid S. Miller <[email protected]>
Mon, 6 Aug 2012 20:23:46 +0000 (13:23 -0700)
This is a regression introduced by: 2265c141086474bbae55a5bb3afa1ebb78ccaa7c
("batman-adv: gateway election code refactoring")

Reported-by: Nicolás Echániz <[email protected]>
Signed-off-by: Marek Lindner <[email protected]>
Acked-by: Antonio Quartulli <[email protected]>
Signed-off-by: Antonio Quartulli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/batman-adv/gateway_client.c

index b421cc49d2cd1f83a88b905047df40e2853c4b0b..fc866f2e4528c71c82ba125c23fb48fbd430b390 100644 (file)
@@ -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)
This page took 0.056749 seconds and 4 git commands to generate.