* [B.A.T.M.A.N.] batman-adv not selecting a gateway when using "client 1" through uci config
@ 2012-07-20 2:24 Nicolás Echániz
2012-07-22 11:20 ` Marek Lindner
0 siblings, 1 reply; 4+ messages in thread
From: Nicolás Echániz @ 2012-07-20 2:24 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
Hi everyone,
I've been experimenting with gateway selection in QuintanaLibre. I have
a very bad gateway that I want to work as a last resort gateway when the
other is down, so I tried changing to gw_mode client 1 and used some
unreal values for the Up/Down speeds to "force" the selection.
Anyway, this is all well, the good gateway gets selected from almost all
the mesh, but the problem is that when I updated the client routers
configuration using uci to make it permanent, I stumbled with this
strange result that you can see here:
http://pastebin.com/pEhcq2TW
there's no gateway being selected until I manually run:
# batctl gw_mode client 1
(which was te current mode anyway)
on each client.
In fact, connected computers are not being served DHCP offers because of
this.
Is this some known behavior or just something I overlooked?
Thanks as ever for your help with batman-adv, which here at the far
south we are loving every day more as little mesh clouds keep spawning
around us :)
Cheers,
NicoEchániz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [B.A.T.M.A.N.] batman-adv not selecting a gateway when using "client 1" through uci config
2012-07-20 2:24 [B.A.T.M.A.N.] batman-adv not selecting a gateway when using "client 1" through uci config Nicolás Echániz
@ 2012-07-22 11:20 ` Marek Lindner
2012-07-23 9:02 ` Nicolás Echániz
0 siblings, 1 reply; 4+ messages in thread
From: Marek Lindner @ 2012-07-22 11:20 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
[-- Attachment #1: Type: Text/Plain, Size: 624 bytes --]
On Friday, July 20, 2012 04:24:11 Nicolás Echániz wrote:
> there's no gateway being selected until I manually run:
> # batctl gw_mode client 1
> (which was te current mode anyway)
> on each client.
>
> In fact, connected computers are not being served DHCP offers because of
> this.
>
> Is this some known behavior or just something I overlooked?
In fact you managed to uncover a regression that was overlooked for quite some
time. Guess gw selection class 1 is rarely used. :-)
Can you apply the attached patch and verify that it fixes the problem ? Here
in my test setup it does.
Regards,
Marek
[-- Attachment #2: 0001-batman-adv-select-an-internet-gateway-if-none-was-ch.patch --]
[-- Type: text/x-patch, Size: 1177 bytes --]
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [B.A.T.M.A.N.] batman-adv not selecting a gateway when using "client 1" through uci config
2012-07-22 11:20 ` Marek Lindner
@ 2012-07-23 9:02 ` Nicolás Echániz
2012-07-23 12:52 ` Marek Lindner
0 siblings, 1 reply; 4+ messages in thread
From: Nicolás Echániz @ 2012-07-23 9:02 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On 07/22/2012 08:20 AM, Marek Lindner wrote:
> On Friday, July 20, 2012 04:24:11 Nicolás Echániz wrote:
>> there's no gateway being selected until I manually run:
>> # batctl gw_mode client 1
>> (which was te current mode anyway)
>> on each client.
>>
>> In fact, connected computers are not being served DHCP offers because of
>> this.
>>
>> Is this some known behavior or just something I overlooked?
>
> In fact you managed to uncover a regression that was overlooked for quite some
> time. Guess gw selection class 1 is rarely used. :-)
>
> Can you apply the attached patch and verify that it fixes the problem ? Here
> in my test setup it does.
Marek patch applied (thanks Guido) and verified.
gw_mode client 1 is now properly selecting a gateway when set in the config.
thanks for your prompt reply :)
cheers,
NicoEchániz
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [B.A.T.M.A.N.] batman-adv not selecting a gateway when using "client 1" through uci config
2012-07-23 9:02 ` Nicolás Echániz
@ 2012-07-23 12:52 ` Marek Lindner
0 siblings, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2012-07-23 12:52 UTC (permalink / raw)
To: The list for a Better Approach To Mobile Ad-hoc Networking
On Monday, July 23, 2012 11:02:49 Nicolás Echániz wrote:
> >> Is this some known behavior or just something I overlooked?
> >
> >
> >
> > In fact you managed to uncover a regression that was overlooked for quite
> > some time. Guess gw selection class 1 is rarely used. :-)
> >
> >
> >
> > Can you apply the attached patch and verify that it fixes the problem ?
> > Here in my test setup it does.
>
> Marek patch applied (thanks Guido) and verified.
> gw_mode client 1 is now properly selecting a gateway when set in the
> config.
Thanks for testing the patch. I updated the OpenWrt package and will provide a
patch that goes into the next release.
Cheers,
Marek
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-23 12:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 2:24 [B.A.T.M.A.N.] batman-adv not selecting a gateway when using "client 1" through uci config Nicolás Echániz
2012-07-22 11:20 ` Marek Lindner
2012-07-23 9:02 ` Nicolás Echániz
2012-07-23 12:52 ` Marek Lindner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.