Message ID | 20250317224300.25985-1-kernel@sandropischinger.de (mailing list archive) |
---|---|
State | New |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [bug,report,net-next] lo.disable_ipv6=1 allows ::1 dst packet to take a default route | expand |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index fb2e99a56529..b27844de3baa 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2193,6 +2193,12 @@ int fib6_table_lookup(struct net *net, struct fib6_table *table, int oif, redo_rt6_select: rt6_select(net, fn, oif, res, strict); + if (ipv6_addr_loopback(&fl6->daddr)) { + struct fib6_info *rt = res->f6i; + + if (!rt || !(rt->fib6_flags & RTF_LOCAL)) + res->f6i = net->ipv6.fib6_null_entry; + } if (res->f6i == net->ipv6.fib6_null_entry) { fn = fib6_backtrack(fn, &fl6->saddr); if (fn)