Skip to content

Commit

Permalink
batman-adv: fix and simplify condition when bonding should be used
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Simon Wunderlich authored and Antonio Quartulli committed Jan 6, 2015
1 parent 7ce67a3 commit 329887a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions net/batman-adv/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 329887a

Please sign in to comment.