Re: [PATCH net v2 1/2] ipv6: honor prefix-length suppression in raw FIB lookups

From
Ido Schimmel <idosch@nvidia.com>
Date
2026-11-16 12:51:09
Also in
linux-kselftest, lkml, netfilter-devel
Reply to
netdev-bot+sashiko@kernel.org, 2026-11-16
On Mon, Nov 16, 2026 at 11:49:41AM +0000, netdev-bot+sashiko@kernel.org wrote:
quoted
diff --git a/net/ipv6/fib6_rules.c b/net/ipv6/fib6_rules.c
index 0ffd7b47a0460..ceb4180bcf2f8 100644
--- a/net/ipv6/fib6_rules.c
+++ b/net/ipv6/fib6_rules.c
@@ -283,9 +283,16 @@ INDIRECT_CALLABLE_SCOPE bool fib6_rule_suppress(struct fib_rule *rule,
 						struct fib_lookup_arg *arg)
 {
 	struct fib6_result *res = arg->result;
-	struct rt6_info *rt = res->rt6;
+	struct rt6_info *rt;
 	struct net_device *dev = NULL;

+	if (arg->lookup_ptr == fib6_table_lookup) {
+		/* Raw lookups report reject routes without an error. */
+		return !(res->fib6_flags & RTF_REJECT) &&
+		       res->f6i->fib6_dst.plen <= rule->suppress_prefixlen;
+	}
[Severity: Medium]

Can the raw and dst paths now disagree for a destination that has a
cached exception route?
Yes, and I already mentioned this here:

https://lore.kernel.org/netdev/20261115154639.GA4121811@shredder/ (local)

[...]
Should the dst branch use the parent FIB entry's prefix length for
RTF_CACHE routes (via rt->from), so that both paths agree? That would also
be closer to what fib4_rule_suppress() does for IPv4. If not, could the
commit message document this divergence?
The dst branch should be fixed to derive the prefix length from the FIB
entry and I will take care of it, but it shouldn't be done in this
patch. The patch is doing the right thing and using the FIB entry in
the "raw path".

Not sure we need to overload the commit message with this info. Maybe
under the '---'.
Thread (7 messages) 7 messages, 3 authors, last reply 18h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help