Commit e2cbc11c authored by Antonio Quartulli's avatar Antonio Quartulli Committed by Sven Eckelmann

batman-adv: move neigh_node->if_incoming->if_status check in find_router()

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: default avatarAntonio Quartulli <ordex@autistici.org>
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent 55922c9d
...@@ -1240,6 +1240,9 @@ struct neigh_node *find_router(struct bat_priv *bat_priv, ...@@ -1240,6 +1240,9 @@ struct neigh_node *find_router(struct bat_priv *bat_priv,
router = find_ifalter_router(primary_orig_node, recv_if); router = find_ifalter_router(primary_orig_node, recv_if);
return_router: return_router:
if (router && router->if_incoming->if_status != IF_ACTIVE)
goto err_unlock;
rcu_read_unlock(); rcu_read_unlock();
return router; return router;
err_unlock: err_unlock:
......
...@@ -314,9 +314,6 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) ...@@ -314,9 +314,6 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
if (!neigh_node) if (!neigh_node)
goto out; goto out;
if (neigh_node->if_incoming->if_status != IF_ACTIVE)
goto out;
if (my_skb_head_push(skb, sizeof(struct unicast_packet)) < 0) if (my_skb_head_push(skb, sizeof(struct unicast_packet)) < 0)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment