From patchwork Thu Feb 3 14:41:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Linus_L=C3=BCssing?= X-Patchwork-Id: 812 Return-Path: Received: from ascomax.hasler.ascom.ch (ascomax.hasler.ascom.ch [139.79.135.1]) by open-mesh.org (Postfix) with ESMTPS id 8A41E154450 for ; Thu, 3 Feb 2011 15:46:31 +0100 (CET) Received: from eiger.ma.tech.ascom.ch (eiger.ma.tech.ascom.ch [139.79.100.1]) by ascomax.hasler.ascom.ch (8.14.4/8.14.4) with ESMTP id p13Ef2hG028386; Thu, 3 Feb 2011 15:41:02 +0100 (MET) Received: from [139.79.100.249] (helo=localhost) by eiger.ma.tech.ascom.ch with esmtp (Exim 3.16 #1) id 1Pl0Mm-0004GE-00; Thu, 03 Feb 2011 15:41:00 +0100 From: =?UTF-8?q?Linus=20L=C3=BCssing?= To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 3 Feb 2011 15:41:03 +0100 Message-Id: <1296744063-11440-1-git-send-email-linus.luessing@ascom.ch> X-Mailer: git-send-email 1.7.2.3 MIME-Version: 1.0 Cc: =?UTF-8?q?Linus=20L=C3=BCssing?= Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Disallow originator addressing within mesh layer 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, 03 Feb 2011 14:46:31 -0000 For a host in the mesh network, the batman layer should be transparent. However, we had one exception, data packets within the mesh network which have the same destination as a originator are being routed to that node, although there is no host that node's bat0 interface and therefore gets dropped anyway. This commit removes this exception. Signed-off-by: Linus Lüssing --- unicast.c | 22 +++------------------- 1 files changed, 3 insertions(+), 19 deletions(-) diff --git a/batman-adv/unicast.c b/batman-adv/unicast.c index 6a9ab61..9b13565 100644 --- a/batman-adv/unicast.c +++ b/batman-adv/unicast.c @@ -295,28 +295,12 @@ int unicast_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv) /* get routing information */ if (is_multicast_ether_addr(ethhdr->h_dest)) { orig_node = (struct orig_node *)gw_get_selected(bat_priv); - if (!orig_node) - goto trans_search; - - kref_get(&orig_node->refcount); - goto find_router; - } else { - rcu_read_lock(); - orig_node = ((struct orig_node *)hash_find(bat_priv->orig_hash, - compare_orig, - choose_orig, - ethhdr->h_dest)); - if (!orig_node) { - rcu_read_unlock(); - goto trans_search; + if (orig_node) { + kref_get(&orig_node->refcount); + goto find_router; } - - kref_get(&orig_node->refcount); - rcu_read_unlock(); - goto find_router; } -trans_search: /* check for hna host - increases orig_node refcount */ orig_node = transtable_search(bat_priv, ethhdr->h_dest);