From: David Ahern <dsahern@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org
Cc: Julian Anastasov <ja@ssi.bg>
Subject: Re: [Patch net v3 1/2] fib: relax source validation check for loopback packets
Date: Wed, 17 Jul 2019 15:59:20 -0600 [thread overview]
Message-ID: <4b5beb7c-a6f7-3a5e-d530-88638dde1ef9@gmail.com> (raw)
In-Reply-To: <20190717214159.25959-2-xiyou.wangcong@gmail.com>
On 7/17/19 3:41 PM, Cong Wang wrote:
> In a rare case where we redirect local packets from veth to lo,
> these packets fail to pass the source validation when rp_filter
> is turned on, as the tracing shows:
>
> <...>-311708 [040] ..s1 7951180.957825: fib_table_lookup: table 254 oif 0 iif 1 src 10.53.180.130 dst 10.53.180.130 tos 0 scope 0 flags 0
> <...>-311708 [040] ..s1 7951180.957826: fib_table_lookup_nh: nexthop dev eth0 oif 4 src 10.53.180.130
>
> So, the fib table lookup returns eth0 as the nexthop even though
> the packets are local and should be routed to loopback nonetheless,
> but they can't pass the dev match check in fib_info_nh_uses_dev()
> without this patch.
>
> It should be safe to relax this check for this special case, as
> normally packets coming out of loopback device still have skb_dst
> so they won't even hit this slow path.
>
> Cc: Julian Anastasov <ja@ssi.bg>
> Cc: David Ahern <dsahern@gmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
> ---
> net/ipv4/fib_frontend.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
Seems ok to me.
Reviewed-by: David Ahern <dsahern@gmail.com>
next prev parent reply other threads:[~2019-07-17 21:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-17 21:41 [Patch net v3 0/2] ipv4: relax source validation check for loopback packets Cong Wang
2019-07-17 21:41 ` [Patch net v3 1/2] fib: " Cong Wang
2019-07-17 21:59 ` David Ahern [this message]
2019-07-17 21:41 ` [Patch net v3 2/2] selftests: add a test case for rp_filter Cong Wang
2019-07-17 21:54 ` David Ahern
2021-11-10 9:18 ` Hangbin Liu
2021-11-15 5:08 ` Cong Wang
2021-11-15 16:06 ` David Ahern
2021-11-17 3:19 ` Hangbin Liu
2021-11-17 4:15 ` David Ahern
2021-11-24 1:05 ` Cong Wang
2021-11-24 1:43 ` Hangbin Liu
2021-11-29 6:40 ` Peilin Ye
2019-07-17 22:23 ` [Patch net v3 0/2] ipv4: relax source validation check for loopback packets 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=4b5beb7c-a6f7-3a5e-d530-88638dde1ef9@gmail.com \
--to=dsahern@gmail.com \
--cc=ja@ssi.bg \
--cc=netdev@vger.kernel.org \
--cc=xiyou.wangcong@gmail.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).