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 19:35:36 -0700 (PDT)	[thread overview]
Message-ID: <20140708.193536.1470966008910828465.davem@davemloft.net> (raw)
In-Reply-To: <20140709044759.009fdce94cf1fb2d872a4a4f@qrator.net>

From: Dmitry Popov <ixaphire@qrator.net>
Date: Wed, 9 Jul 2014 04:47:59 +0400

> How I see ip_tunnel_lookup logic:
> 1) try to find exact match (and if found return this tunnel):
> tunnel.saddr == iph.daddr && tunnel.daddr == iph.saddr && key_matched()
> 2) try to find matched (local) wildcard tunnel:
> tunnel.saddr == any && tunnel.daddr == iph.saddr && key_matched()
> 3) try to find matched (remote) wildcard tunnel:
> tunnel.saddr == iph.daddr && tunnel.daddr == any && key_matched()
> (there is also a test for multicast tunnel, but let's skip it for simplicity)
> 4) try to find matched (full) wildcard tunnel:
> tunnel.saddr == any && tunnel.daddr == any && key_matched()
> 5) if nothing found return default tunnel.
> 
> According to this logic, in 4th loop (the one you quoted) we have to test that
> tunnel.daddr == any && tunnel.saddr == any. In my opinion those two new lines
> are the best way to achieve it.

Now it makes sense, thanks for explaining.

Applied and queued up for -stable, thanks again.

      reply	other threads:[~2014-07-09  2:35 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
2014-07-09  0:47   ` Dmitry Popov
2014-07-09  2:35     ` David Miller [this message]

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.193536.1470966008910828465.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).