batman-adv: gateway selection class 1 fix
authorMarek Lindner <lindner_marek@yahoo.de>
Mon, 23 Jul 2012 12:51:20 +0000 (12:51 +0000)
committerMarek Lindner <lindner_marek@yahoo.de>
Mon, 23 Jul 2012 12:51:20 +0000 (12:51 +0000)
More info: https://lists.open-mesh.org/pipermail/b.a.t.m.a.n/2012-July/007766.html

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
git-svn-id: svn://svn.openwrt.org/openwrt/packages/net/batman-adv@32789 3c298f89-4303-0410-b956-a3cf2f4a3e73

Makefile
patches/0004-batman-adv-select-an-internet-gateway-if-none-was-ch.patch [new file with mode: 0644]

index 4012fe97a86e8b4cd5008a42f5300e118a182813..e0ba232d2fc0e48cbcd15ef6e19d75ea39dd664f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ PKG_NAME:=batman-adv
 
 PKG_VERSION:=2012.2.0
 BATCTL_VERSION:=2012.2.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_MD5SUM:=68967ed1df709de18ab795722dde9341
 BATCTL_MD5SUM:=7abd284098c514d3f2858e8a956c495e
 
diff --git a/patches/0004-batman-adv-select-an-internet-gateway-if-none-was-ch.patch b/patches/0004-batman-adv-select-an-internet-gateway-if-none-was-ch.patch
new file mode 100644 (file)
index 0000000..fae2ec4
--- /dev/null
@@ -0,0 +1,38 @@
+From 0a29f3a348c68f375585e25153da0f0a061fd71d Mon Sep 17 00:00:00 2001
+From: Marek Lindner <lindner_marek@yahoo.de>
+Date: Sun, 22 Jul 2012 13:04:48 +0200
+Subject: [PATCH] batman-adv: select an internet gateway if none was chosen
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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>
+---
+ gateway_client.c |    6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/gateway_client.c b/gateway_client.c
+index 47f7186..dace001 100644
+--- a/gateway_client.c
++++ b/gateway_client.c
+@@ -197,11 +197,11 @@ void gw_election(struct bat_priv *bat_priv)
+       if (atomic_read(&bat_priv->gw_mode) != GW_MODE_CLIENT)
+               goto out;
+-      if (!atomic_dec_not_zero(&bat_priv->gw_reselect))
+-              goto out;
+-
+       curr_gw = gw_get_selected_gw_node(bat_priv);
++      if (!atomic_dec_not_zero(&bat_priv->gw_reselect) && curr_gw)
++              goto out;
++
+       next_gw = gw_get_best_gw_node(bat_priv);
+       if (curr_gw == next_gw)
+-- 
+1.7.9.1
+