Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221963
b: refs/heads/master
c: f581cf2
h: refs/heads/master
i:
  221961: b246407
  221959: 39c6de2
v: v3
  • Loading branch information
Chris Lang authored and Greg Kroah-Hartman committed Nov 10, 2010
1 parent 2e23b12 commit 7835821
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31a9f47aa081292d1c750002724aa23b3bd44bb8
refs/heads/master: f581cf21b48c305c6fbbc3db5ef905deb19131e5
12 changes: 4 additions & 8 deletions trunk/drivers/staging/batman-adv/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -1000,10 +1000,10 @@ int recv_icmp_packet(struct sk_buff *skb, struct batman_if *recv_if)

/* find a suitable router for this originator, and use
* bonding if possible. */
struct neigh_node *find_router(struct orig_node *orig_node,
struct neigh_node *find_router(struct bat_priv *bat_priv,
struct orig_node *orig_node,
struct batman_if *recv_if)
{
struct bat_priv *bat_priv;
struct orig_node *primary_orig_node;
struct orig_node *router_orig;
struct neigh_node *router, *first_candidate, *best_router;
Expand All @@ -1019,13 +1019,9 @@ struct neigh_node *find_router(struct orig_node *orig_node,
/* without bonding, the first node should
* always choose the default router. */

if (!recv_if)
return orig_node->router;

bat_priv = netdev_priv(recv_if->soft_iface);
bonding_enabled = atomic_read(&bat_priv->bonding_enabled);

if (!bonding_enabled)
if ((!recv_if) && (!bonding_enabled))
return orig_node->router;

router_orig = orig_node->router->orig_node;
Expand Down Expand Up @@ -1154,7 +1150,7 @@ static int route_unicast_packet(struct sk_buff *skb,
orig_node = ((struct orig_node *)
hash_find(bat_priv->orig_hash, unicast_packet->dest));

router = find_router(orig_node, recv_if);
router = find_router(bat_priv, orig_node, recv_if);

if (!router) {
spin_unlock_irqrestore(&bat_priv->orig_hash_lock, flags);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/staging/batman-adv/routing.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ int recv_ucast_frag_packet(struct sk_buff *skb, struct batman_if *recv_if);
int recv_bcast_packet(struct sk_buff *skb, struct batman_if *recv_if);
int recv_vis_packet(struct sk_buff *skb, struct batman_if *recv_if);
int recv_bat_packet(struct sk_buff *skb, struct batman_if *recv_if);
struct neigh_node *find_router(struct orig_node *orig_node,
struct batman_if *recv_if);
struct neigh_node *find_router(struct bat_priv *bat_priv,
struct orig_node *orig_node, struct batman_if *recv_if);
void update_bonding_candidates(struct bat_priv *bat_priv,
struct orig_node *orig_node);

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/batman-adv/unicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv)
if (!orig_node)
orig_node = transtable_search(bat_priv, ethhdr->h_dest);

router = find_router(orig_node, NULL);
router = find_router(bat_priv, orig_node, NULL);

if (!router)
goto unlock;
Expand Down

0 comments on commit 7835821

Please sign in to comment.