b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: fix and simplify condition when bonding should be used
@ 2014-08-13 12:26 Simon Wunderlich
  2014-11-09  4:26 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Wunderlich @ 2014-08-13 12:26 UTC (permalink / raw)
  To: b.a.t.m.a.n

The current condition actually does NOT consider bonding when the
interface the packet came in from is the soft interface, which is the
opposite of what it should do (and the comment describes). Fix that and
slightly simplify the condition.

Reported-by: Ray Gibson <booray@gmail.com>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 routing.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/routing.c b/routing.c
index 35f76f2..6648f32 100644
--- a/routing.c
+++ b/routing.c
@@ -443,11 +443,13 @@ batadv_find_router(struct batadv_priv *bat_priv,
 
 	router = batadv_orig_router_get(orig_node, recv_if);
 
+	if (!router)
+		return router;
+
 	/* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop)
 	 * and if activated.
 	 */
-	if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) ||
-	    !router)
+	if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding)))
 		return router;
 
 	/* bonding: loop through the list of possible routers found
-- 
2.1.0.rc1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: fix and simplify condition when bonding should be used
  2014-08-13 12:26 [B.A.T.M.A.N.] [PATCH] batman-adv: fix and simplify condition when bonding should be used Simon Wunderlich
@ 2014-11-09  4:26 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2014-11-09  4:26 UTC (permalink / raw)
  To: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

On Wednesday 13 August 2014 14:26:56 Simon Wunderlich wrote:
> The current condition actually does NOT consider bonding when the
> interface the packet came in from is the soft interface, which is the
> opposite of what it should do (and the comment describes). Fix that and
> slightly simplify the condition.
> 
> Reported-by: Ray Gibson <booray@gmail.com>
> Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
> ---
>  routing.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Applied in revision 47dc789.

Thanks,
Marek

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-11-09  4:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-13 12:26 [B.A.T.M.A.N.] [PATCH] batman-adv: fix and simplify condition when bonding should be used Simon Wunderlich
2014-11-09  4:26 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).