Thread (4 messages) flat view 4 messages, 2 authors, 2014-07-09

Re: [PATCH] ip_tunnel: fix ip_tunnel_lookup

From: David Miller <davem@davemloft.net>
Date: 2014-07-08 22:12:14
Also in: lkml

From: Dmitry Popov <redacted>
Date: Sat, 5 Jul 2014 02:26:37 +0400
quoted hunk ↗ jump to hunk
@@ -205,6 +207,8 @@ struct ip_tunnel *ip_tunnel_lookup(struct ip_tunnel_net *itn,
 
 	hlist_for_each_entry_rcu(t, head, hash_node) {
 		if (t->parms.i_key != key ||
+		    t->parms.iph.saddr != 0 ||
+		    t->parms.iph.daddr != 0 ||
 		    !(t->dev->flags & IFF_UP))
 			continue;
 
I don't really understand the logic of these tests.

Usually the canonical way to test these kinds of things is:

	if (parms->saddr && parms->saddr != saddr)
		goto no_match;

But you are signalling a non-match any time the address is not a
wildcard.

Why?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help