public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Re-Enable Interface alternating and bonding
@ 2010-10-25  6:34 ` Chris Lang
  2010-10-25 12:44   ` Marek Lindner
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Lang @ 2010-10-25  6:34 UTC (permalink / raw)
  To: b.a.t.m.a.n

r1765 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@gateworks.com>
---
 routing.c |   12 ++++--------
 routing.h |    4 ++--
 unicast.c |    2 +-
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/routing.c b/routing.c
index 7c9a053..f1012bc 100644
--- a/routing.c
+++ b/routing.c
@@ -1001,10 +1001,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;
@@ -1020,13 +1020,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;
@@ -1155,7 +1151,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);
diff --git a/routing.h b/routing.h
index 06ea99d..92674c8 100644
--- a/routing.h
+++ b/routing.h
@@ -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);
 
diff --git a/unicast.c b/unicast.c
index 0dac50d..0459413 100644
--- a/unicast.c
+++ b/unicast.c
@@ -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;
-- 
1.7.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Re-Enable Interface alternating and bonding
  2010-10-25  6:34 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Re-Enable Interface alternating and bonding Chris Lang
@ 2010-10-25 12:44   ` Marek Lindner
  2010-10-25 15:36     ` Chris Lang
  0 siblings, 1 reply; 4+ messages in thread
From: Marek Lindner @ 2010-10-25 12:44 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Monday 25 October 2010 08:34:48 Chris Lang wrote:
> r1765 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.

Wow - what a catch! :-)
We might have to reword your commit message to get your patch accepted by the 
Linux stable maintainers. I offer to do the job if you don't mind.

Cheers,
Marek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Re-Enable Interface alternating and bonding
  2010-10-25 12:44   ` Marek Lindner
@ 2010-10-25 15:36     ` Chris Lang
  2010-10-25 22:22       ` Marek Lindner
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Lang @ 2010-10-25 15:36 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Mon, 2010-10-25 at 14:44 +0200, Marek Lindner wrote:
> On Monday 25 October 2010 08:34:48 Chris Lang wrote:
> > r1765 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.
> 
> Wow - what a catch! :-)
> We might have to reword your commit message to get your patch accepted by the 
> Linux stable maintainers. I offer to do the job if you don't mind.
> 
> Cheers,
> Marek

Marek,

I don't have any issue with you rewording the commit message. I just
didn't think about making the commit message linux friendly.

Thanks,

-- 
Chris Lang
Gateworks Corporation
3026 S. Higuera, San Luis Obispo, CA 93401
Ph: 805-781-2000 Fax: 805-781-2001
Email: clang@gateworks.com
Web: www.gateworks.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Re-Enable Interface alternating and bonding
  2010-10-25 15:36     ` Chris Lang
@ 2010-10-25 22:22       ` Marek Lindner
  0 siblings, 0 replies; 4+ messages in thread
From: Marek Lindner @ 2010-10-25 22:22 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Monday 25 October 2010 17:36:30 Chris Lang wrote:
> I don't have any issue with you rewording the commit message. I just
> didn't think about making the commit message linux friendly.

Ok, applied your patch in revision 1853.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-10-25 22:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <clang@gateworks.com>
2010-10-25  6:34 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Re-Enable Interface alternating and bonding Chris Lang
2010-10-25 12:44   ` Marek Lindner
2010-10-25 15:36     ` Chris Lang
2010-10-25 22:22       ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox