From patchwork Mon Jul 23 12:59:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 2212 Return-Path: Received: from nm16-vm0.bullet.mail.ukl.yahoo.com (nm16-vm0.bullet.mail.ukl.yahoo.com [217.146.183.254]) by open-mesh.org (Postfix) with SMTP id A35566009B8 for ; Mon, 23 Jul 2012 14:59:24 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass reason="1024-bit key; insecure key" header.i=@yahoo.de header.b=qvfL01we; dkim-adsp=pass; dkim-atps=neutral Received: from [217.146.183.182] by nm16.bullet.mail.ukl.yahoo.com with NNFMP; 23 Jul 2012 12:59:24 -0000 Received: from [217.146.183.109] by tm13.bullet.mail.ukl.yahoo.com with NNFMP; 23 Jul 2012 12:59:24 -0000 Received: from [127.0.0.1] by smtp110.mail.ukl.yahoo.com with NNFMP; 23 Jul 2012 12:59:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1343048364; bh=L+WRu8N1QYKwfArR3k6QoEW4The3mP98IkXLFVP6uYQ=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:MIME-Version:Content-Type:Content-Transfer-Encoding; b=qvfL01weWhK9NGKQL/8ngZYMeq1TsxGSGVVgCFXB5elhyODcD2j/mCvElPAp8AU+gOznH1kANRQZngtCGoGImYvaADH59c2dK0WD50LjVy56ZscSe5Vm30xGJbuRv7Wwlp19jzJMNc6s0RFoNf1FdoibZDKFwz34WPrusAal5S0= X-Yahoo-Newman-Id: 479358.31358.bm@smtp110.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: EzRwwMsVM1lQ21qHg2fPeCWx1ysDJJWG4yvpzlZDKqG8f.l 8iFVlqflGG8DwDypinGHZySy4HtBamy3CCVuSZXTKNmaUIfr2ljdDPbfDkFu EAp4lpuPeK1LuhA45rIa08FsmOI7f7Xnudv23sNhlCYQ_ACaSrkLhvBTSdi7 hzpx_o4DWF_raOaNEFAr4nSNyr77xyLi4.I4NL4nZ04b9R0H21EPSL9EBDmq 9Q_Gjf9aIC4MKh1wHg0qQORkXHd8CWT1GhjkLWXH5pDoYfw.fyI1lQVmlHjZ CakfXEWG.agQzWms45dHJxoWUqdfmo9zeUjco_b8VNOZzJy_vM7vvFetbjFG Kqj8pJ4aPAHNcF5TXocV7CRQIT4MN35R3d5dU8t.1S6z4Qgz2QePRSYkcagH Jx_6pzdmKqcOwNU7rpDc.42BPbiJMGatumRyB3kpXg8JNPZ8- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@217.85.81.115 with plain) by smtp110.mail.ukl.yahoo.com with SMTP; 23 Jul 2012 05:59:23 -0700 PDT From: Marek Lindner To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 23 Jul 2012 14:59:13 +0200 Message-Id: <1343048353-23456-1-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.9.1 MIME-Version: 1.0 Cc: Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: select an internet gateway if none was chosen X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jul 2012 12:59:24 -0000 This is a regression introduced by: 6a17ecc4603be7f065c38b288d038a0082bbf21d Reported-by: Nicolás Echániz Signed-off-by: Marek Lindner Acked-by: Antonio Quartulli --- This patch is intended for next and needs to be backported for stable. gateway_client.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gateway_client.c b/gateway_client.c index b421cc4..fc866f2 100644 --- a/gateway_client.c +++ b/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)