diff options
author | Simon Wunderlich <sw@simonwunderlich.de> | 2014-08-13 08:26:56 -0400 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2015-01-06 05:05:07 -0500 |
commit | 329887ad13a3f3d26837ea9fce5a8305a7c983e2 (patch) | |
tree | daafbc99322eb05a1dc9bd37fe37fe3b2c4bbf46 /net/batman-adv | |
parent | 7ce67a38f799d1fb332f672b117efbadedaa5352 (diff) |
batman-adv: fix and simplify condition when bonding should be used
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>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv')
-rw-r--r-- | net/batman-adv/routing.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 35f76f2f7824..6648f321864d 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c | |||
@@ -443,11 +443,13 @@ batadv_find_router(struct batadv_priv *bat_priv, | |||
443 | 443 | ||
444 | router = batadv_orig_router_get(orig_node, recv_if); | 444 | router = batadv_orig_router_get(orig_node, recv_if); |
445 | 445 | ||
446 | if (!router) | ||
447 | return router; | ||
448 | |||
446 | /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop) | 449 | /* only consider bonding for recv_if == BATADV_IF_DEFAULT (first hop) |
447 | * and if activated. | 450 | * and if activated. |
448 | */ | 451 | */ |
449 | if (recv_if == BATADV_IF_DEFAULT || !atomic_read(&bat_priv->bonding) || | 452 | if (!(recv_if == BATADV_IF_DEFAULT && atomic_read(&bat_priv->bonding))) |
450 | !router) | ||
451 | return router; | 453 | return router; |
452 | 454 | ||
453 | /* bonding: loop through the list of possible routers found | 455 | /* bonding: loop through the list of possible routers found |