netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: ixaphire@qrator.net
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ip_tunnel: fix ip_tunnel_lookup
Date: Tue, 08 Jul 2014 15:12:10 -0700 (PDT)	[thread overview]
Message-ID: <20140708.151210.1879376103263511218.davem@davemloft.net> (raw)
In-Reply-To: <20140705022637.73152ff57309c468c1fdb563@qrator.net>

From: Dmitry Popov <ixaphire@qrator.net>
Date: Sat, 5 Jul 2014 02:26:37 +0400

> @@ -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?

  reply	other threads:[~2014-07-08 22:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-04 22:26 [PATCH] ip_tunnel: fix ip_tunnel_lookup Dmitry Popov
2014-07-08 22:12 ` David Miller [this message]
2014-07-09  0:47   ` Dmitry Popov
2014-07-09  2:35     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140708.151210.1879376103263511218.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=ixaphire@qrator.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).