From: David Miller <davem@davemloft.net>
To: lorenzo@google.com
Cc: netdev@vger.kernel.org, dsahern@gmail.com, rami.rosen@intel.com,
nikolay@cumulusnetworks.com, roopa@cumulusnetworks.com
Subject: Re: [PATCH net] net: ipv4: Make "ip route get" match iif lo rules again.
Date: Mon, 15 Jan 2018 13:54:19 -0500 (EST) [thread overview]
Message-ID: <20180115.135419.992724517936932654.davem@davemloft.net> (raw)
In-Reply-To: <20180111093626.214125-1-lorenzo@google.com>
From: Lorenzo Colitti <lorenzo@google.com>
Date: Thu, 11 Jan 2018 18:36:26 +0900
> Commit 3765d35ed8b9 ("net: ipv4: Convert inet_rtm_getroute to rcu
> versions of route lookup") broke "ip route get" in the presence
> of rules that specify iif lo.
>
> Host-originated traffic always has iif lo, because
> ip_route_output_key_hash and ip6_route_output_flags set the flow
> iif to LOOPBACK_IFINDEX. Thus, putting "iif lo" in an ip rule is a
> convenient way to select only originated traffic and not forwarded
> traffic.
>
> inet_rtm_getroute used to match these rules correctly because
> even though it sets the flow iif to 0, it called
> ip_route_output_key which overwrites iif with LOOPBACK_IFINDEX.
> But now that it calls ip_route_output_key_hash_rcu, the ifindex
> will remain 0 and not match the iif lo in the rule. As a result,
> "ip route get" will return ENETUNREACH.
>
> Fixes: 3765d35ed8b9 ("net: ipv4: Convert inet_rtm_getroute to rcu versions of route lookup")
> Tested: https://android.googlesource.com/kernel/tests/+/master/net/test/multinetwork_test.py passes again
> Signed-off-by: Lorenzo Colitti <lorenzo@google.com>
Applied and queued up for -stable, thanks!
prev parent reply other threads:[~2018-01-15 18:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-11 9:36 [PATCH net] net: ipv4: Make "ip route get" match iif lo rules again Lorenzo Colitti
2018-01-11 13:55 ` David Ahern
2018-01-15 18:54 ` 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=20180115.135419.992724517936932654.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=lorenzo@google.com \
--cc=netdev@vger.kernel.org \
--cc=nikolay@cumulusnetworks.com \
--cc=rami.rosen@intel.com \
--cc=roopa@cumulusnetworks.com \
/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).