Skip to content

Commit

Permalink
batman-adv: move neigh_node->if_incoming->if_status check in find_rou…
Browse files Browse the repository at this point in the history
…ter()

Every time that find_router() is invoked, if_status has to be compared with
IF_ACTIVE. Moving this comparison inside find_router() will avoid to write it
each time.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
  • Loading branch information
Antonio Quartulli authored and Sven Eckelmann committed May 30, 2011
1 parent 55922c9 commit e2cbc11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions net/batman-adv/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,6 +1240,9 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
router = find_ifalter_router(primary_orig_node, recv_if);

return_router:
if (router && router->if_incoming->if_status != IF_ACTIVE)
goto err_unlock;

rcu_read_unlock();
return router;
err_unlock:
Expand Down
3 changes: 0 additions & 3 deletions net/batman-adv/unicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,6 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
if (!neigh_node)
goto out;

if (neigh_node->if_incoming->if_status != IF_ACTIVE)
goto out;

if (my_skb_head_push(skb, sizeof(struct unicast_packet)) < 0)
goto out;

Expand Down

0 comments on commit e2cbc11

Please sign in to comment.