The following commit has been merged in the batman-adv/next branch: commit 8f0cd737e96764be6e8fba8924048d3596a016d5 Author: Marek Lindner lindner_marek@yahoo.de Date: Mon Jul 23 14:59:13 2012 +0200
batman-adv: select an internet gateway if none was chosen
This is a regression introduced by: 6a17ecc4603be7f065c38b288d038a0082bbf21d
Reported-by: Nicolás Echániz nicoechaniz@codigosur.org Signed-off-by: Marek Lindner lindner_marek@yahoo.de Acked-by: Antonio Quartulli ordex@autistici.org Signed-off-by: Antonio Quartulli ordex@autistici.org
diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c index 177c552..15d67ab 100644 --- a/net/batman-adv/gateway_client.c +++ b/net/batman-adv/gateway_client.c @@ -205,11 +205,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)