From patchwork Thu Nov 4 22:02:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 534 Return-Path: Received: from mail.gmx.net (mailout-de.gmx.net [213.165.64.23]) by open-mesh.org (Postfix) with SMTP id 83602154576 for ; Thu, 4 Nov 2010 23:00:44 +0100 (CET) Received: (qmail invoked by alias); 04 Nov 2010 22:00:44 -0000 Received: from vpnclient-202-092.hrz.tu-chemnitz.de (EHLO sven-desktop.lazhur.ath.cx) [134.109.202.92] by mail.gmx.net (mp037) with SMTP; 04 Nov 2010 23:00:44 +0100 X-Authenticated: #15668376 X-Provags-ID: V01U2FsdGVkX19DqMQOW9FDDK2/4KA68AJFirouldgSpjJntthwWb OsfIUW1nWpafn9 From: Sven Eckelmann To: greg@kroah.com Date: Thu, 4 Nov 2010 23:02:29 +0100 Message-Id: <1288908150-19744-3-git-send-email-sven.eckelmann@gmx.de> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1288908150-19744-1-git-send-email-sven.eckelmann@gmx.de> References: <1288908150-19744-1-git-send-email-sven.eckelmann@gmx.de> X-Y-GMX-Trusted: 0 Cc: Marek Lindner , b.a.t.m.a.n@lists.open-mesh.org Subject: [B.A.T.M.A.N.] [PATCH 2/3] Staging: batman-adv: fix interface alternating and bonding reggression X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2010 22:00:44 -0000 From: Chris Lang 55d1666b521cbed95924c8d4775fe272c103f08c 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 Signed-off-by: Marek Lindner Signed-off-by: Sven Eckelmann --- drivers/staging/batman-adv/routing.c | 12 ++++-------- drivers/staging/batman-adv/routing.h | 4 ++-- 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 9010263..657b69e 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) /* 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; @@ -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; @@ -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); diff --git a/drivers/staging/batman-adv/routing.h b/drivers/staging/batman-adv/routing.h index 06ea99d..92674c8 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); 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/drivers/staging/batman-adv/unicast.c b/drivers/staging/batman-adv/unicast.c index 0dac50d..0459413 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) 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;