From: Paolo Abeni <pabeni@redhat.com>
To: Menglong Dong <menglong8.dong@gmail.com>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
dsahern@kernel.org, pablo@netfilter.org, kadlec@netfilter.org,
roopa@nvidia.com, razor@blackwall.org, gnault@redhat.com,
bigeasy@linutronix.de, idosch@nvidia.com, ast@kernel.org,
dongml2@chinatelecom.cn, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, netfilter-devel@vger.kernel.org,
coreteam@netfilter.org, bridge@lists.linux.dev,
bpf@vger.kernel.org
Subject: Re: [PATCH net-next v3 01/10] net: ip: refactor fib_validate_source/__fib_validate_source
Date: Mon, 21 Oct 2024 12:03:05 +0200 [thread overview]
Message-ID: <86d785cd-41de-484d-ae17-ffdb4aa9393e@redhat.com> (raw)
In-Reply-To: <20241015140800.159466-2-dongml2@chinatelecom.cn>
On 10/15/24 16:07, Menglong Dong wrote:
> @@ -352,6 +353,28 @@ static int __fib_validate_source(struct sk_buff *skb, __be32 src, __be32 dst,
> struct flowi4 fl4;
> bool dev_match;
>
> + /* Ignore rp_filter for packets protected by IPsec. */
> + if (!rpf && !fib_num_tclassid_users(net) &&
> + (dev->ifindex != oif || !IN_DEV_TX_REDIRECTS(idev))) {
> + if (IN_DEV_ACCEPT_LOCAL(idev))
> + goto last_resort;
IMHO the re-usage of the 'last_resort' macro makes the patch a little
hard to read, as this is an 'accept' condition. I think it would be
better to retain the original code. If you really want to avoid the
small duplication, you could instead introduce an 'ok' label towards the
end of this function:
last_resort:
if (rpf)
goto e_rpf;
ok:
*itag = 0;
return 0;
And jump there.
Thanks,
Paolo
next prev parent reply other threads:[~2024-10-21 10:03 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-15 14:07 [PATCH net-next v3 00/10] net: ip: add drop reasons to input route Menglong Dong
2024-10-15 14:07 ` [PATCH net-next v3 01/10] net: ip: refactor fib_validate_source/__fib_validate_source Menglong Dong
2024-10-21 10:03 ` Paolo Abeni [this message]
2024-10-15 14:07 ` [PATCH net-next v3 02/10] net: ip: make fib_validate_source() return drop reason Menglong Dong
2024-10-21 10:20 ` Paolo Abeni
2024-10-21 10:36 ` Paolo Abeni
2024-10-22 8:47 ` Menglong Dong
2024-10-15 14:07 ` [PATCH net-next v3 03/10] net: ip: make ip_route_input_mc() " Menglong Dong
2024-10-15 14:07 ` [PATCH net-next v3 04/10] net: ip: make ip_mc_validate_source() " Menglong Dong
2024-10-15 14:07 ` [PATCH net-next v3 05/10] net: ip: make ip_route_input_slow() return drop reasons Menglong Dong
2024-10-21 10:52 ` Paolo Abeni
2024-10-22 8:50 ` Menglong Dong
2024-10-15 14:07 ` [PATCH net-next v3 06/10] net: ip: make ip_route_input_rcu() " Menglong Dong
2024-10-15 14:07 ` [PATCH net-next v3 07/10] net: ip: make ip_route_input_noref() " Menglong Dong
2024-10-21 10:44 ` Paolo Abeni
2024-10-21 10:49 ` Paolo Abeni
2024-10-22 8:49 ` Menglong Dong
2024-10-15 14:07 ` [PATCH net-next v3 08/10] net: ip: make ip_route_input() " Menglong Dong
2024-10-15 14:07 ` [PATCH net-next v3 09/10] net: ip: make ip_mkroute_input/__mkroute_input " Menglong Dong
2024-10-15 14:08 ` [PATCH net-next v3 10/10] net: ip: make ip_route_use_hint() " Menglong Dong
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=86d785cd-41de-484d-ae17-ffdb4aa9393e@redhat.com \
--to=pabeni@redhat.com \
--cc=ast@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=bpf@vger.kernel.org \
--cc=bridge@lists.linux.dev \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=dongml2@chinatelecom.cn \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=gnault@redhat.com \
--cc=idosch@nvidia.com \
--cc=kadlec@netfilter.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=menglong8.dong@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
--cc=razor@blackwall.org \
--cc=roopa@nvidia.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).