Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'ipv6-allow-for-nexthop-device-mismatch-with-onlink'

Ido Schimmel says:

====================
ipv6: Allow for nexthop device mismatch with "onlink"

This patchset aligns IPv6 with IPv4 with respect to the "onlink" keyword
and allows IPv6 routes to be configured with a gateway address that is
resolved out of a different interface than the one specified.

Patches #1-#3 are small preparations in the existing "onlink" selftest.

Patch #4 is the actual change. See the commit message for detailed
description and motivation.

Patch #5 adds test cases for both address families, to make sure that
this use case does not regress.
====================

Link: https://patch.msgid.link/20260111120813.159799-1-idosch@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+16 -19
+2 -5
net/ipv6/route.c
··· 3419 3419 3420 3420 err = ip6_nh_lookup_table(net, cfg, gw_addr, tbid, 0, &res); 3421 3421 if (!err && !(res.fib6_flags & RTF_REJECT) && 3422 - /* ignore match if it is the default route */ 3423 - !ipv6_addr_any(&res.f6i->fib6_dst.addr) && 3424 - (res.fib6_type != RTN_UNICAST || dev != res.nh->fib_nh_dev)) { 3425 - NL_SET_ERR_MSG(extack, 3426 - "Nexthop has invalid gateway or device mismatch"); 3422 + res.fib6_type != RTN_UNICAST) { 3423 + NL_SET_ERR_MSG(extack, "Nexthop has invalid gateway"); 3427 3424 err = -EINVAL; 3428 3425 } 3429 3426