b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: Disallow originator addressing within mesh layer
@ 2011-02-03 14:41 Linus Lüssing
  2011-02-07  0:11 ` Marek Lindner
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Lüssing @ 2011-02-03 14:41 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Linus Lüssing

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 <linus.luessing@ascom.ch>
---
 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);
 
-- 
1.7.2.3


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

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: Disallow originator addressing within mesh layer
  2011-02-03 14:41 [B.A.T.M.A.N.] [PATCH] batman-adv: Disallow originator addressing within mesh layer Linus Lüssing
@ 2011-02-07  0:11 ` Marek Lindner
  0 siblings, 0 replies; 2+ messages in thread
From: Marek Lindner @ 2011-02-07  0:11 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Thursday 03 February 2011 15:41:03 Linus Lüssing wrote:
> 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.

Applied in revision 1934.

Thanks,
Marek

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

end of thread, other threads:[~2011-02-07  0:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-03 14:41 [B.A.T.M.A.N.] [PATCH] batman-adv: Disallow originator addressing within mesh layer Linus Lüssing
2011-02-07  0:11 ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).