The following commit has been merged in the master branch:
commit 6532f9933a1e5e998829c1426a956d72586fd280
Author: Chris Lang <clang(a)gateworks.com>
Date: Mon Oct 25 22:22:46 2010 +0000
batman-adv: fix interface alternating and bonding reggression
The 'attach each hard-interface to a soft-interface' patch incidentally
disabled bonding of packets first entering the mesh along with also
disabling interface alternating regardless of where the packet came from.
This re-enables these options.
Signed-off-by: Chris Lang <clang(a)gateworks.com>
diff --git a/routing.c b/routing.c
index e0c994d..e75337d 100644
--- a/routing.c
+++ b/routing.c
@@ -1011,10 +1011,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;
@@ -1030,13 +1030,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);
- if (!bonding_enabled)
+ if ((!recv_if) && (!bonding_enabled))
return orig_node->router;
router_orig = orig_node->router->orig_node;
@@ -1162,7 +1158,7 @@ int route_unicast_packet(struct sk_buff *skb, struct batman_if
*recv_if,
hash_find(bat_priv->orig_hash, compare_orig, choose_orig,
unicast_packet->dest));
- router = find_router(orig_node, recv_if);
+ router = find_router(bat_priv, orig_node, recv_if);
if (!router) {
spin_unlock_bh(&bat_priv->orig_hash_lock);
diff --git a/routing.h b/routing.h
index 8f7db1c..f108f23 100644
--- a/routing.h
+++ b/routing.h
@@ -40,8 +40,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);
diff --git a/unicast.c b/unicast.c
index 943be77..7b9385b 100644
--- a/unicast.c
+++ b/unicast.c
@@ -295,7 +295,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;
--
batman-adv
Show replies by date