diff options
-rw-r--r-- | drivers/staging/batman-adv/routing.c | 12 | ||||
-rw-r--r-- | drivers/staging/batman-adv/routing.h | 4 | ||||
-rw-r--r-- | drivers/staging/batman-adv/unicast.c | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/drivers/staging/batman-adv/routing.c b/drivers/staging/batman-adv/routing.c index 90102631330b..657b69e6b957 100644 --- a/drivers/staging/batman-adv/routing.c +++ b/drivers/staging/batman-adv/routing.c | |||
@@ -1000,10 +1000,10 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if) | |||
1000 | 1000 | ||
1001 | /* find a suitable router for this originator, and use | 1001 | /* find a suitable router for this originator, and use |
1002 | * bonding if possible. */ | 1002 | * bonding if possible. */ |
1003 | struct neigh_node *find_router(struct orig_node *orig_node, | 1003 | struct neigh_node *find_router(struct bat_priv *bat_priv, |
1004 | struct orig_node *orig_node, | ||
1004 | struct batman_if *recv_if) | 1005 | struct batman_if *recv_if) |
1005 | { | 1006 | { |
1006 | struct bat_priv *bat_priv; | ||
1007 | struct orig_node *primary_orig_node; | 1007 | struct orig_node *primary_orig_node; |
1008 | struct orig_node *router_orig; | 1008 | struct orig_node *router_orig; |
1009 | struct neigh_node *router, *first_candidate, *best_router; | 1009 | struct neigh_node *router, *first_candidate, *best_router; |
@@ -1019,13 +1019,9 @@ struct neigh_node *find_router(struct orig_node *orig_node, | |||
1019 | /* without bonding, the first node should | 1019 | /* without bonding, the first node should |
1020 | * always choose the default router. */ | 1020 | * always choose the default router. */ |
1021 | 1021 | ||
1022 | if (!recv_if) | ||
1023 | return orig_node->router; | ||
1024 | |||
1025 | bat_priv = netdev_priv(recv_if->soft_iface); | ||
1026 | bonding_enabled = atomic_read(&bat_priv->bonding_enabled); | 1022 | bonding_enabled = atomic_read(&bat_priv->bonding_enabled); |
1027 | 1023 | ||
1028 | if (!bonding_enabled) | 1024 | if ((!recv_if) && (!bonding_enabled)) |
1029 | return orig_node->router; | 1025 | return orig_node->router; |
1030 | 1026 | ||
1031 | router_orig = orig_node->router->orig_node; | 1027 | router_orig = orig_node->router->orig_node; |
@@ -1154,7 +1150,7 @@ static int route_unicast_packet(struct sk_buff *skb, | |||
1154 | orig_node = ((struct orig_node *) | 1150 | orig_node = ((struct orig_node *) |
1155 | hash_find(bat_priv->orig_hash, unicast_packet->dest)); | 1151 | hash_find(bat_priv->orig_hash, unicast_packet->dest)); |
1156 | 1152 | ||
1157 | router = find_router(orig_node, recv_if); | 1153 | router = find_router(bat_priv, orig_node, recv_if); |
1158 | 1154 | ||
1159 | if (!router) { | 1155 | if (!router) { |
1160 | spin_unlock_irqrestore(&bat_priv->orig_hash_lock, flags); | 1156 | spin_unlock_irqrestore(&bat_priv->orig_hash_lock, flags); |
diff --git a/drivers/staging/batman-adv/routing.h b/drivers/staging/batman-adv/routing.h index 06ea99df3706..92674c8d9c03 100644 --- a/drivers/staging/batman-adv/routing.h +++ b/drivers/staging/batman-adv/routing.h | |||
@@ -38,8 +38,8 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if); | |||
38 | int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if); | 38 | int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if); |
39 | int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if); | 39 | int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if); |
40 | int recv_bat_packet(struct sk_buff *skb, struct batman_if *recv_if); | 40 | int recv_bat_packet(struct sk_buff *skb, struct batman_if *recv_if); |
41 | struct neigh_node *find_router(struct orig_node *orig_node, | 41 | struct neigh_node *find_router(struct bat_priv *bat_priv, |
42 | struct batman_if *recv_if); | 42 | struct orig_node *orig_node, struct batman_if *recv_if); |
43 | void update_bonding_candidates(struct bat_priv *bat_priv, | 43 | void update_bonding_candidates(struct bat_priv *bat_priv, |
44 | struct orig_node *orig_node); | 44 | struct orig_node *orig_node); |
45 | 45 | ||
diff --git a/drivers/staging/batman-adv/unicast.c b/drivers/staging/batman-adv/unicast.c index 0dac50d69c03..0459413ff67f 100644 --- a/drivers/staging/batman-adv/unicast.c +++ b/drivers/staging/batman-adv/unicast.c | |||
@@ -224,7 +224,7 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) | |||
224 | if (!orig_node) | 224 | if (!orig_node) |
225 | orig_node = transtable_search(bat_priv, ethhdr->h_dest); | 225 | orig_node = transtable_search(bat_priv, ethhdr->h_dest); |
226 | 226 | ||
227 | router = find_router(orig_node, NULL); | 227 | router = find_router(bat_priv, orig_node, NULL); |
228 | 228 | ||
229 | if (!router) | 229 | if (!router) |
230 | goto unlock; | 230 | goto unlock; |