From patchwork Tue May 28 09:49:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 3030 Return-Path: Received: from cora.hrz.tu-chemnitz.de (cora.hrz.tu-chemnitz.de [134.109.228.40]) by open-mesh.org (Postfix) with ESMTPS id 88995600726 for ; Tue, 28 May 2013 11:50:01 +0200 (CEST) Received: from p549bcd34.dip0.t-ipconnect.de ([84.155.205.52] helo=pandem0nium) by cora.hrz.tu-chemnitz.de with esmtpsa (TLSv1:DHE-RSA-AES128-SHA:128) (Exim 4.80.1) (envelope-from ) id 1UhGXX-0003ec-9f; Tue, 28 May 2013 11:49:59 +0200 Received: from dotslash by pandem0nium with local (Exim 4.80) (envelope-from ) id 1UhGXT-0003Pt-I2; Tue, 28 May 2013 11:49:55 +0200 From: Simon Wunderlich To: b.a.t.m.a.n@lists.open-mesh.org Date: Tue, 28 May 2013 11:49:47 +0200 Message-Id: <1369734587-13104-1-git-send-email-siwu@hrz.tu-chemnitz.de> X-Mailer: git-send-email 1.7.10.4 X-purgate: clean X-purgate-type: clean X-purgate-ID: 154106::1369734599-0000051A-FEAF3635/0-0/0-0 X-Scan-AV: cora.hrz.tu-chemnitz.de; 2013-05-28 11:49:59; bcdf5e72c50a9eb314c6d204311b8de8 X-Scan-SA: cora.hrz.tu-chemnitz.de; 2013-05-28 11:49:59; b85a9da503af9747961e41353bddd0b4 X-Spam-Score: -1.0 (-) X-Spam-Report: --- Textanalyse SpamAssassin 3.3.1 (-1.0 Punkte) Fragen an/questions to: Postmaster TU Chemnitz * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP --- Ende Textanalyse Cc: Simon Wunderlich Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: remove useless find_router look up X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.15 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: Tue, 28 May 2013 09:50:01 -0000 From: Simon Wunderlich This is not used anymore with the new fragmentation, and it might actually mess up the bonding code because find_router() assumes it is only called once per packet. Signed-off-by: Simon Wunderlich --- This patch was originally part of the RFC series "add network wide multi interface optimization", but since it is just a fix it is resent as PATCH to be applied now. --- send.c | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/send.c b/send.c index 8f74201..d780b9d 100644 --- a/send.c +++ b/send.c @@ -251,30 +251,19 @@ int batadv_send_skb_generic_unicast(struct batadv_priv *bat_priv, struct ethhdr *ethhdr = (struct ethhdr *)skb->data; struct batadv_unicast_packet *unicast_packet; struct batadv_orig_node *orig_node; - struct batadv_neigh_node *neigh_node; int ret = NET_RX_DROP; /* get routing information */ - if (is_multicast_ether_addr(ethhdr->h_dest)) { + if (is_multicast_ether_addr(ethhdr->h_dest)) orig_node = batadv_gw_get_selected_orig(bat_priv); - if (orig_node) - goto find_router; - } + else + /* check for tt host - increases orig_node refcount. + * returns NULL in case of AP isolation + */ + orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source, + ethhdr->h_dest); - /* check for tt host - increases orig_node refcount. - * returns NULL in case of AP isolation - */ - orig_node = batadv_transtable_search(bat_priv, ethhdr->h_source, - ethhdr->h_dest); - -find_router: - /* find_router(): - * - if orig_node is NULL it returns NULL - * - increases neigh_nodes refcount if found. - */ - neigh_node = batadv_find_router(bat_priv, orig_node, NULL); - - if (!neigh_node) + if (!orig_node) goto out; switch (packet_type) { @@ -306,8 +295,6 @@ find_router: ret = 0; out: - if (neigh_node) - batadv_neigh_node_free_ref(neigh_node); if (orig_node) batadv_orig_node_free_ref(orig_node); if (ret == NET_RX_DROP)