From: Ido Schimmel <idosch@idosch.org>
To: hanhuihui <hanhuihui5@huawei.com>
Cc: dsahern@kernel.org, kuba@kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] resume oif rule match l3mdev in fib_lookup
Date: Mon, 14 Apr 2025 10:17:31 +0300 [thread overview]
Message-ID: <Z_y2i05h0uLFnkhb@shredder> (raw)
In-Reply-To: <20250412131910.15559-1-hanhuihui5@huawei.com>
On Sat, Apr 12, 2025 at 09:19:10PM +0800, hanhuihui wrote:
> flowi_oif will be reset if flowi_oif set to a l3mdev (e.g., VRF) device.
> This causes the oif rule to fail to match the l3mdev device in fib_lookup.
> Let's get back to previous behavior.
>
> Fixes: 40867d74c374 ("net: Add l3mdev index to flow struct and avoid oif reset for port devices")
> Signed-off-by: hanhuihui hanhuihui5@huawei.com
> ---
> net/core/fib_rules.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
> index 4bc64d9..3c2a2db 100644
> --- a/net/core/fib_rules.c
> +++ b/net/core/fib_rules.c
> @@ -268,7 +268,7 @@ static int fib_rule_match(struct fib_rule *rule, struct fib_rules_ops *ops,
> goto out;
>
> oifindex = READ_ONCE(rule->oifindex);
> - if (oifindex && (oifindex != fl->flowi_oif))
> + if (oifindex && (oifindex != (fl->flowi_l3mdev ? : fl->flowi_oif)))
This will prevent us from matching on the output device when the device
is enslaved to a VRF. We should try to match on L3 domain only if the
FIB rule matches on a VRF device. I will try to send a fix today (wasn't
feeling well in the last few days).
> goto out;
>
> if ((rule->mark ^ fl->flowi_mark) & rule->mark_mask)
> --
> 2.27.0
>
next prev parent reply other threads:[~2025-04-14 7:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-03 1:58 VRF Routing Rule Matching Issue: oif Rules Not Working After Commit 40867d74c374 hanhuihui
2025-04-07 8:29 ` Ido Schimmel
2025-04-08 16:17 ` hanhuihui
2025-04-08 16:49 ` David Ahern
2025-04-08 19:54 ` Ido Schimmel
2025-04-12 13:17 ` hanhuihui
2025-04-12 13:19 ` [PATCH] resume oif rule match l3mdev in fib_lookup hanhuihui
2025-04-12 23:25 ` Jakub Kicinski
2025-04-14 7:17 ` Ido Schimmel [this message]
2025-04-14 17:24 ` Ido Schimmel
2025-04-15 14:11 ` hanhuihui
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=Z_y2i05h0uLFnkhb@shredder \
--to=idosch@idosch.org \
--cc=dsahern@kernel.org \
--cc=hanhuihui5@huawei.com \
--cc=kuba@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).