* [PATCH net-next v2 0/2] ipv6: Honor oif when choosing nexthop for locally generated traffic @ 2026-06-01 6:52 Ido Schimmel 2026-06-01 6:52 ` [PATCH net-next v2 1/2] " Ido Schimmel 2026-06-01 6:53 ` [PATCH net-next v2 2/2] selftests: fib_tests: Add test cases for route lookup with oif Ido Schimmel 0 siblings, 2 replies; 6+ messages in thread From: Ido Schimmel @ 2026-06-01 6:52 UTC (permalink / raw) To: netdev; +Cc: davem, kuba, pabeni, edumazet, dsahern, horms, willemb, Ido Schimmel Patch #1 aligns IPv6 with IPv4 and changes IPv6 route lookup to prefer a nexthop whose nexthop device matches the specified oif. Patch #2 adds a selftest. v2: - Add tests with VRFs. v1: https://lore.kernel.org/netdev/20251224161801.824589-1-idosch@nvidia.com/ Ido Schimmel (2): ipv6: Honor oif when choosing nexthop for locally generated traffic selftests: fib_tests: Add test cases for route lookup with oif net/ipv6/route.c | 5 +- tools/testing/selftests/net/fib_tests.sh | 183 ++++++++++++++++++++++- 2 files changed, 186 insertions(+), 2 deletions(-) -- 2.54.0 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next v2 1/2] ipv6: Honor oif when choosing nexthop for locally generated traffic 2026-06-01 6:52 [PATCH net-next v2 0/2] ipv6: Honor oif when choosing nexthop for locally generated traffic Ido Schimmel @ 2026-06-01 6:52 ` Ido Schimmel 2026-06-02 2:51 ` David Ahern 2026-06-02 11:49 ` Ido Schimmel 2026-06-01 6:53 ` [PATCH net-next v2 2/2] selftests: fib_tests: Add test cases for route lookup with oif Ido Schimmel 1 sibling, 2 replies; 6+ messages in thread From: Ido Schimmel @ 2026-06-01 6:52 UTC (permalink / raw) To: netdev; +Cc: davem, kuba, pabeni, edumazet, dsahern, horms, willemb, Ido Schimmel Commit 741a11d9e410 ("net: ipv6: Add RT6_LOOKUP_F_IFACE flag if oif is set") made the kernel honor the oif parameter when specified as part of output route lookup: # ip route add 2001:db8:1::/64 dev dummy1 # ip route add ::/0 dev dummy2 # ip route get 2001:db8:1::1 oif dummy2 fibmatch default dev dummy2 metric 1024 pref medium Due to regression reports, the behavior was partially reverted in commit d46a9d678e4c ("net: ipv6: Dont add RT6_LOOKUP_F_IFACE flag if saddr set") to only honor the oif if source address is not specified: # ip route get 2001:db8:1::1 from 2001:db8:2::1 oif dummy2 fibmatch 2001:db8:1::/64 dev dummy1 metric 1024 pref medium That is, when source address is specified, the kernel will choose the most specific route even if its nexthop device does not match the specified oif. This creates a problem for multipath routes. After looking up a route, when source address is not specified, the kernel will choose a nexthop whose nexthop device matches the specified oif: # sysctl -wq net.ipv6.conf.all.forwarding=1 # ip route add 2001:db8:10::/64 nexthop via fe80::1 dev dummy1 nexthop via fe80::2 dev dummy2 # for i in {1..100}; do ip route get 2001:db8:10::${i} oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c 100 dummy2 But will disregard the oif when source address is specified despite the fact that a matching nexthop exists: # for i in {1..100}; do ip route get 2001:db8:10::${i} from 2001:db8:2::1 oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c 53 dummy1 47 dummy2 This behavior differs from IPv4: # ip address add 192.0.2.1/32 dev lo # ip route add 198.51.100.0/24 nexthop via inet6 fe80::1 dev dummy1 nexthop via inet6 fe80::2 dev dummy2 # for i in {1..100}; do ip route get 198.51.100.${i} from 192.0.2.1 oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c 100 dummy2 What happens is that fib6_table_lookup() returns a route with a matching nexthop device (assuming it exists): # perf record -e fib6:fib6_table_lookup -- bash -c "for i in {1..100}; do ip route get 2001:db8:10::${i} from 2001:db8:2::1 oif dummy2; done > /dev/null" # perf script | grep -o dummy[0-9] | sort | uniq -c 100 dummy2 But it is later overwritten during path selection in fib6_select_path() which instead chooses a nexthop according to the calculated hash. Solve this by telling fib6_select_path() to skip path selection if we have an oif match during output route lookup (iif being LOOPBACK_IFINDEX). Behavior after the change: # sysctl -wq net.ipv6.conf.all.forwarding=1 # ip route add 2001:db8:10::/64 nexthop via fe80::1 dev dummy1 nexthop via fe80::2 dev dummy2 # for i in {1..100}; do ip route get 2001:db8:10::${i} from 2001:db8:2::1 oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c 100 dummy2 Note that enabling forwarding is only needed because we did not add neighbor entries for the gateway addresses. When forwarding is disabled and CONFIG_IPV6_ROUTER_PREF is not enabled in kernel config, the kernel will treat non-existing neighbor entries as errors and perform round-robin between the nexthops: # sysctl -wq net.ipv6.conf.all.forwarding=0 # for i in {1..100}; do ip route get 2001:db8:10::${i} from 2001:db8:2::1 oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c 50 dummy1 50 dummy2 Signed-off-by: Ido Schimmel <idosch@nvidia.com> --- net/ipv6/route.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/ipv6/route.c b/net/ipv6/route.c index b106e5fef9cb..14633fd72288 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -2272,6 +2272,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, { struct fib6_result res = {}; struct rt6_info *rt = NULL; + bool have_oif_match; int strict = 0; WARN_ON_ONCE((flags & RT6_LOOKUP_F_DST_NOREF) && @@ -2288,7 +2289,9 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, if (res.f6i == net->ipv6.fib6_null_entry) goto out; - fib6_select_path(net, &res, fl6, oif, false, skb, strict); + have_oif_match = fl6->flowi6_iif == LOOPBACK_IFINDEX && + oif == res.nh->fib_nh_dev->ifindex; + fib6_select_path(net, &res, fl6, oif, have_oif_match, skb, strict); /*Search through exception table */ rt = rt6_find_cached_rt(&res, &fl6->daddr, &fl6->saddr); -- 2.54.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 1/2] ipv6: Honor oif when choosing nexthop for locally generated traffic 2026-06-01 6:52 ` [PATCH net-next v2 1/2] " Ido Schimmel @ 2026-06-02 2:51 ` David Ahern 2026-06-02 11:49 ` Ido Schimmel 1 sibling, 0 replies; 6+ messages in thread From: David Ahern @ 2026-06-02 2:51 UTC (permalink / raw) To: Ido Schimmel, netdev; +Cc: davem, kuba, pabeni, edumazet, horms, willemb On 6/1/26 12:52 AM, Ido Schimmel wrote: > Commit 741a11d9e410 ("net: ipv6: Add RT6_LOOKUP_F_IFACE flag if oif is > set") made the kernel honor the oif parameter when specified as part of > output route lookup: > > # ip route add 2001:db8:1::/64 dev dummy1 > # ip route add ::/0 dev dummy2 > # ip route get 2001:db8:1::1 oif dummy2 fibmatch > default dev dummy2 metric 1024 pref medium > > Due to regression reports, the behavior was partially reverted in commit > d46a9d678e4c ("net: ipv6: Dont add RT6_LOOKUP_F_IFACE flag if saddr > set") to only honor the oif if source address is not specified: > > # ip route get 2001:db8:1::1 from 2001:db8:2::1 oif dummy2 fibmatch > 2001:db8:1::/64 dev dummy1 metric 1024 pref medium > > That is, when source address is specified, the kernel will choose the > most specific route even if its nexthop device does not match the > specified oif. > > This creates a problem for multipath routes. After looking up a route, > when source address is not specified, the kernel will choose a nexthop > whose nexthop device matches the specified oif: > > # sysctl -wq net.ipv6.conf.all.forwarding=1 > # ip route add 2001:db8:10::/64 nexthop via fe80::1 dev dummy1 nexthop via fe80::2 dev dummy2 > # for i in {1..100}; do ip route get 2001:db8:10::${i} oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c > 100 dummy2 > > But will disregard the oif when source address is specified despite the > fact that a matching nexthop exists: > > # for i in {1..100}; do ip route get 2001:db8:10::${i} from 2001:db8:2::1 oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c > 53 dummy1 > 47 dummy2 > > This behavior differs from IPv4: > > # ip address add 192.0.2.1/32 dev lo > # ip route add 198.51.100.0/24 nexthop via inet6 fe80::1 dev dummy1 nexthop via inet6 fe80::2 dev dummy2 > # for i in {1..100}; do ip route get 198.51.100.${i} from 192.0.2.1 oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c > 100 dummy2 > > What happens is that fib6_table_lookup() returns a route with a matching > nexthop device (assuming it exists): > > # perf record -e fib6:fib6_table_lookup -- bash -c "for i in {1..100}; do ip route get 2001:db8:10::${i} from 2001:db8:2::1 oif dummy2; done > /dev/null" > # perf script | grep -o dummy[0-9] | sort | uniq -c > 100 dummy2 > > But it is later overwritten during path selection in fib6_select_path() > which instead chooses a nexthop according to the calculated hash. > > Solve this by telling fib6_select_path() to skip path selection if we > have an oif match during output route lookup (iif being > LOOPBACK_IFINDEX). > > Behavior after the change: > > # sysctl -wq net.ipv6.conf.all.forwarding=1 > # ip route add 2001:db8:10::/64 nexthop via fe80::1 dev dummy1 nexthop via fe80::2 dev dummy2 > # for i in {1..100}; do ip route get 2001:db8:10::${i} from 2001:db8:2::1 oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c > 100 dummy2 > > Note that enabling forwarding is only needed because we did not add > neighbor entries for the gateway addresses. When forwarding is disabled > and CONFIG_IPV6_ROUTER_PREF is not enabled in kernel config, the kernel > will treat non-existing neighbor entries as errors and perform > round-robin between the nexthops: > > # sysctl -wq net.ipv6.conf.all.forwarding=0 > # for i in {1..100}; do ip route get 2001:db8:10::${i} from 2001:db8:2::1 oif dummy2; done | grep -o dummy[0-9] | sort | uniq -c > 50 dummy1 > 50 dummy2 > > Signed-off-by: Ido Schimmel <idosch@nvidia.com> > --- > net/ipv6/route.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > Reviewed-by: David Ahern <dsahern@kernel.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 1/2] ipv6: Honor oif when choosing nexthop for locally generated traffic 2026-06-01 6:52 ` [PATCH net-next v2 1/2] " Ido Schimmel 2026-06-02 2:51 ` David Ahern @ 2026-06-02 11:49 ` Ido Schimmel 1 sibling, 0 replies; 6+ messages in thread From: Ido Schimmel @ 2026-06-02 11:49 UTC (permalink / raw) To: netdev; +Cc: davem, kuba, pabeni, edumazet, dsahern, horms, willemb On Mon, Jun 01, 2026 at 09:52:59AM +0300, Ido Schimmel wrote: > diff --git a/net/ipv6/route.c b/net/ipv6/route.c > index b106e5fef9cb..14633fd72288 100644 > --- a/net/ipv6/route.c > +++ b/net/ipv6/route.c > @@ -2272,6 +2272,7 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, > { > struct fib6_result res = {}; > struct rt6_info *rt = NULL; > + bool have_oif_match; > int strict = 0; > > WARN_ON_ONCE((flags & RT6_LOOKUP_F_DST_NOREF) && > @@ -2288,7 +2289,9 @@ struct rt6_info *ip6_pol_route(struct net *net, struct fib6_table *table, > if (res.f6i == net->ipv6.fib6_null_entry) > goto out; > > - fib6_select_path(net, &res, fl6, oif, false, skb, strict); > + have_oif_match = fl6->flowi6_iif == LOOPBACK_IFINDEX && > + oif == res.nh->fib_nh_dev->ifindex; > + fib6_select_path(net, &res, fl6, oif, have_oif_match, skb, strict); > > /*Search through exception table */ > rt = rt6_find_cached_rt(&res, &fl6->daddr, &fl6->saddr); The patch is fine as-is, but Sashiko [1] is correct that there is a pre-existing issue when the route is using a nexthop group object. I will prepend a patch for this in the next version and add test cases. pw-bot: changes-requested [1] This is a pre-existing issue, but does this logic leave the regression unfixed for routes using Nexthop objects? The fix relies on res.nh containing the best matching path. However, when a source address is specified, RT6_LOOKUP_F_IFACE is not set. For Nexthop objects, the lookup in __find_rr_leaf() evaluates paths using nexthop_for_each_fib6_nh() with the rt6_nh_find_match() callback. Because the initial score (*mpri) is -1, the first valid (but non-matching) path will score 0, which causes find_match() to return true. This aborts the iteration immediately, without evaluating subsequent paths that might be an exact oif match (which would score 2). As a result, in ip6_pol_route(), res.nh is assigned an arbitrary path. The have_oif_match variable evaluates to false, and the code incorrectly falls back to hash-based selection via nexthop_path_fib6_result() for Nexthop objects. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH net-next v2 2/2] selftests: fib_tests: Add test cases for route lookup with oif 2026-06-01 6:52 [PATCH net-next v2 0/2] ipv6: Honor oif when choosing nexthop for locally generated traffic Ido Schimmel 2026-06-01 6:52 ` [PATCH net-next v2 1/2] " Ido Schimmel @ 2026-06-01 6:53 ` Ido Schimmel 2026-06-02 2:53 ` David Ahern 1 sibling, 1 reply; 6+ messages in thread From: Ido Schimmel @ 2026-06-01 6:53 UTC (permalink / raw) To: netdev; +Cc: davem, kuba, pabeni, edumazet, dsahern, horms, willemb, Ido Schimmel Test that both address families respect the oif parameter when a matching multipath route is found, regardless of the presence of a source address. Output without "ipv6: Honor oif when choosing nexthop for locally generated traffic": # ./fib_tests.sh -t "ipv4_mpath_oif ipv4_mpath_oif_vrf ipv6_mpath_oif ipv6_mpath_oif_vrf" IPv4 multipath oif test TEST: IPv4 multipath via first nexthop [ OK ] TEST: IPv4 multipath via second nexthop [ OK ] TEST: IPv4 multipath via first nexthop with source address [ OK ] TEST: IPv4 multipath via second nexthop with source address [ OK ] IPv4 multipath oif with VRF test TEST: IPv4 multipath via first nexthop [ OK ] TEST: IPv4 multipath via second nexthop [ OK ] TEST: IPv4 multipath via first nexthop with source address [ OK ] TEST: IPv4 multipath via second nexthop with source address [ OK ] IPv6 multipath oif test TEST: IPv6 multipath via first nexthop [ OK ] TEST: IPv6 multipath via second nexthop [ OK ] TEST: IPv6 multipath via first nexthop with source address [FAIL] TEST: IPv6 multipath via second nexthop with source address [FAIL] IPv6 multipath oif with VRF test TEST: IPv6 multipath via first nexthop [ OK ] TEST: IPv6 multipath via second nexthop [ OK ] TEST: IPv6 multipath via first nexthop with source address [FAIL] TEST: IPv6 multipath via second nexthop with source address [FAIL] Tests passed: 12 Tests failed: 4 Output with "ipv6: Honor oif when choosing nexthop for locally generated traffic": # ./fib_tests.sh -t "ipv4_mpath_oif ipv4_mpath_oif_vrf ipv6_mpath_oif ipv6_mpath_oif_vrf" IPv4 multipath oif test TEST: IPv4 multipath via first nexthop [ OK ] TEST: IPv4 multipath via second nexthop [ OK ] TEST: IPv4 multipath via first nexthop with source address [ OK ] TEST: IPv4 multipath via second nexthop with source address [ OK ] IPv4 multipath oif with VRF test TEST: IPv4 multipath via first nexthop [ OK ] TEST: IPv4 multipath via second nexthop [ OK ] TEST: IPv4 multipath via first nexthop with source address [ OK ] TEST: IPv4 multipath via second nexthop with source address [ OK ] IPv6 multipath oif test TEST: IPv6 multipath via first nexthop [ OK ] TEST: IPv6 multipath via second nexthop [ OK ] TEST: IPv6 multipath via first nexthop with source address [ OK ] TEST: IPv6 multipath via second nexthop with source address [ OK ] IPv6 multipath oif with VRF test TEST: IPv6 multipath via first nexthop [ OK ] TEST: IPv6 multipath via second nexthop [ OK ] TEST: IPv6 multipath via first nexthop with source address [ OK ] TEST: IPv6 multipath via second nexthop with source address [ OK ] Tests passed: 16 Tests failed: 0 Signed-off-by: Ido Schimmel <idosch@nvidia.com> --- tools/testing/selftests/net/fib_tests.sh | 183 ++++++++++++++++++++++- 1 file changed, 182 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/net/fib_tests.sh b/tools/testing/selftests/net/fib_tests.sh index 8f10de0eb985..1b2e9a0b21d0 100755 --- a/tools/testing/selftests/net/fib_tests.sh +++ b/tools/testing/selftests/net/fib_tests.sh @@ -12,7 +12,9 @@ TESTS="unregister down carrier nexthop suppress ipv6_notify ipv4_notify \ ipv4_route_metrics ipv4_route_v6_gw rp_filter ipv4_del_addr \ ipv6_del_addr ipv4_mangle ipv6_mangle ipv4_bcast_neigh fib6_gc_test \ ipv4_mpath_list ipv6_mpath_list ipv4_mpath_balance ipv6_mpath_balance \ - ipv4_mpath_balance_preferred fib6_ra_to_static fib6_temp_addr_renewal" + ipv4_mpath_balance_preferred ipv4_mpath_oif ipv4_mpath_oif_vrf \ + ipv6_mpath_oif ipv6_mpath_oif_vrf fib6_ra_to_static \ + fib6_temp_addr_renewal" VERBOSE=0 PAUSE_ON_FAIL=no @@ -2971,6 +2973,181 @@ ipv6_mpath_balance_test() forwarding_cleanup } +ipv4_mpath_oif_test_common() +{ + local get_param=$1; shift + local expected_oif=$1; shift + local test_name=$1; shift + local tmp_file + + tmp_file=$(mktemp) + + for i in {1..100}; do + $IP route get 203.0.113.${i} $get_param >> "$tmp_file" + done + + [[ $(grep "$expected_oif" "$tmp_file" | wc -l) -eq 100 ]] + log_test $? 0 "$test_name" + + rm "$tmp_file" +} + +ipv4_mpath_oif_test() +{ + echo + echo "IPv4 multipath oif test" + + setup + + set -e + $IP link add dummy1 up type dummy + $IP address add 192.0.2.1/28 dev dummy1 + $IP address add 192.0.2.17/32 dev lo + + $IP route add 203.0.113.0/24 \ + nexthop via 198.51.100.2 dev dummy0 \ + nexthop via 192.0.2.2 dev dummy1 + set +e + + ipv4_mpath_oif_test_common "oif dummy0" "dummy0" \ + "IPv4 multipath via first nexthop" + + ipv4_mpath_oif_test_common "oif dummy1" "dummy1" \ + "IPv4 multipath via second nexthop" + + ipv4_mpath_oif_test_common "oif dummy0 from 192.0.2.17" "dummy0" \ + "IPv4 multipath via first nexthop with source address" + + ipv4_mpath_oif_test_common "oif dummy1 from 192.0.2.17" "dummy1" \ + "IPv4 multipath via second nexthop with source address" + + cleanup +} + +ipv4_mpath_oif_vrf_test() +{ + echo + echo "IPv4 multipath oif with VRF test" + + setup + + set -e + $IP -4 rule add pref 32765 table local + $IP -4 rule del pref 0 + $IP link add name vrf-123 up type vrf table 123 + $IP link set dev dummy0 master vrf-123 + $IP link add dummy1 up master vrf-123 type dummy + $IP address add 192.0.2.1/28 dev dummy1 + $IP address add 192.0.2.17/32 dev vrf-123 + + $IP route add 203.0.113.0/24 vrf vrf-123 \ + nexthop via 198.51.100.2 dev dummy0 \ + nexthop via 192.0.2.2 dev dummy1 + set +e + + ipv4_mpath_oif_test_common "oif dummy0" "dummy0" \ + "IPv4 multipath via first nexthop" + + ipv4_mpath_oif_test_common "oif dummy1" "dummy1" \ + "IPv4 multipath via second nexthop" + + ipv4_mpath_oif_test_common "oif dummy0 from 192.0.2.17" "dummy0" \ + "IPv4 multipath via first nexthop with source address" + + ipv4_mpath_oif_test_common "oif dummy1 from 192.0.2.17" "dummy1" \ + "IPv4 multipath via second nexthop with source address" + + cleanup +} + +ipv6_mpath_oif_test_common() +{ + local get_param=$1; shift + local expected_oif=$1; shift + local test_name=$1; shift + local tmp_file + + tmp_file=$(mktemp) + + for i in {1..100}; do + $IP route get 2001:db8:10::${i} $get_param >> "$tmp_file" + done + + [[ $(grep "$expected_oif" "$tmp_file" | wc -l) -eq 100 ]] + log_test $? 0 "$test_name" + + rm "$tmp_file" +} + +ipv6_mpath_oif_test() +{ + echo + echo "IPv6 multipath oif test" + + setup + + set -e + $IP link add dummy1 up type dummy + $IP address add 2001:db8:2::1/64 dev dummy1 + $IP address add 2001:db8:100::1/128 dev lo + + $IP route add 2001:db8:10::/64 \ + nexthop via 2001:db8:1::2 dev dummy0 \ + nexthop via 2001:db8:2::2 dev dummy1 + set +e + + ipv6_mpath_oif_test_common "oif dummy0" "dummy0" \ + "IPv6 multipath via first nexthop" + + ipv6_mpath_oif_test_common "oif dummy1" "dummy1" \ + "IPv6 multipath via second nexthop" + + ipv6_mpath_oif_test_common "oif dummy0 from 2001:db8:100::1" "dummy0" \ + "IPv6 multipath via first nexthop with source address" + + ipv6_mpath_oif_test_common "oif dummy1 from 2001:db8:100::1" "dummy1" \ + "IPv6 multipath via second nexthop with source address" + + cleanup +} + +ipv6_mpath_oif_vrf_test() +{ + echo + echo "IPv6 multipath oif with VRF test" + + setup + + set -e + $NS_EXEC sysctl -qw net.ipv6.conf.all.keep_addr_on_down=1 + $IP -6 rule add pref 32765 table local + $IP -6 rule del pref 0 + $IP link add name vrf-123 up type vrf table 123 + $IP link set dev dummy0 master vrf-123 + $IP link add dummy1 up master vrf-123 type dummy + $IP address add 2001:db8:2::1/64 dev dummy1 + $IP address add 2001:db8:100::1/128 dev vrf-123 + + $IP route add 2001:db8:10::/64 vrf vrf-123 \ + nexthop via 2001:db8:1::2 dev dummy0 \ + nexthop via 2001:db8:2::2 dev dummy1 + set +e + + ipv6_mpath_oif_test_common "oif dummy0" "dummy0" \ + "IPv6 multipath via first nexthop" + + ipv6_mpath_oif_test_common "oif dummy1" "dummy1" \ + "IPv6 multipath via second nexthop" + + ipv6_mpath_oif_test_common "oif dummy0 from 2001:db8:100::1" "dummy0" \ + "IPv6 multipath via first nexthop with source address" + + ipv6_mpath_oif_test_common "oif dummy1 from 2001:db8:100::1" "dummy1" \ + "IPv6 multipath via second nexthop with source address" + + cleanup +} + ################################################################################ # usage @@ -3057,6 +3234,10 @@ do ipv4_mpath_balance) ipv4_mpath_balance_test;; ipv6_mpath_balance) ipv6_mpath_balance_test;; ipv4_mpath_balance_preferred) ipv4_mpath_balance_preferred_test;; + ipv4_mpath_oif) ipv4_mpath_oif_test;; + ipv4_mpath_oif_vrf) ipv4_mpath_oif_vrf_test;; + ipv6_mpath_oif) ipv6_mpath_oif_test;; + ipv6_mpath_oif_vrf) ipv6_mpath_oif_vrf_test;; fib6_ra_to_static) fib6_ra_to_static;; fib6_temp_addr_renewal) fib6_temp_addr_renewal;; -- 2.54.0 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net-next v2 2/2] selftests: fib_tests: Add test cases for route lookup with oif 2026-06-01 6:53 ` [PATCH net-next v2 2/2] selftests: fib_tests: Add test cases for route lookup with oif Ido Schimmel @ 2026-06-02 2:53 ` David Ahern 0 siblings, 0 replies; 6+ messages in thread From: David Ahern @ 2026-06-02 2:53 UTC (permalink / raw) To: Ido Schimmel, netdev; +Cc: davem, kuba, pabeni, edumazet, horms, willemb On 6/1/26 12:53 AM, Ido Schimmel wrote: > Test that both address families respect the oif parameter when a > matching multipath route is found, regardless of the presence of a > source address. > > Output without "ipv6: Honor oif when choosing nexthop for locally > generated traffic": > > # ./fib_tests.sh -t "ipv4_mpath_oif ipv4_mpath_oif_vrf ipv6_mpath_oif ipv6_mpath_oif_vrf" > > IPv4 multipath oif test > TEST: IPv4 multipath via first nexthop [ OK ] > TEST: IPv4 multipath via second nexthop [ OK ] > TEST: IPv4 multipath via first nexthop with source address [ OK ] > TEST: IPv4 multipath via second nexthop with source address [ OK ] > > IPv4 multipath oif with VRF test > TEST: IPv4 multipath via first nexthop [ OK ] > TEST: IPv4 multipath via second nexthop [ OK ] > TEST: IPv4 multipath via first nexthop with source address [ OK ] > TEST: IPv4 multipath via second nexthop with source address [ OK ] > > IPv6 multipath oif test > TEST: IPv6 multipath via first nexthop [ OK ] > TEST: IPv6 multipath via second nexthop [ OK ] > TEST: IPv6 multipath via first nexthop with source address [FAIL] > TEST: IPv6 multipath via second nexthop with source address [FAIL] > > IPv6 multipath oif with VRF test > TEST: IPv6 multipath via first nexthop [ OK ] > TEST: IPv6 multipath via second nexthop [ OK ] > TEST: IPv6 multipath via first nexthop with source address [FAIL] > TEST: IPv6 multipath via second nexthop with source address [FAIL] > > Tests passed: 12 > Tests failed: 4 > > Output with "ipv6: Honor oif when choosing nexthop for locally generated > traffic": > > # ./fib_tests.sh -t "ipv4_mpath_oif ipv4_mpath_oif_vrf ipv6_mpath_oif ipv6_mpath_oif_vrf" > > IPv4 multipath oif test > TEST: IPv4 multipath via first nexthop [ OK ] > TEST: IPv4 multipath via second nexthop [ OK ] > TEST: IPv4 multipath via first nexthop with source address [ OK ] > TEST: IPv4 multipath via second nexthop with source address [ OK ] > > IPv4 multipath oif with VRF test > TEST: IPv4 multipath via first nexthop [ OK ] > TEST: IPv4 multipath via second nexthop [ OK ] > TEST: IPv4 multipath via first nexthop with source address [ OK ] > TEST: IPv4 multipath via second nexthop with source address [ OK ] > > IPv6 multipath oif test > TEST: IPv6 multipath via first nexthop [ OK ] > TEST: IPv6 multipath via second nexthop [ OK ] > TEST: IPv6 multipath via first nexthop with source address [ OK ] > TEST: IPv6 multipath via second nexthop with source address [ OK ] > > IPv6 multipath oif with VRF test > TEST: IPv6 multipath via first nexthop [ OK ] > TEST: IPv6 multipath via second nexthop [ OK ] > TEST: IPv6 multipath via first nexthop with source address [ OK ] > TEST: IPv6 multipath via second nexthop with source address [ OK ] > > Tests passed: 16 > Tests failed: 0 > > Signed-off-by: Ido Schimmel <idosch@nvidia.com> > --- > tools/testing/selftests/net/fib_tests.sh | 183 ++++++++++++++++++++++- > 1 file changed, 182 insertions(+), 1 deletion(-) > Reviewed-by: David Ahern <dsahern@kernel.org> ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-06-02 11:49 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-06-01 6:52 [PATCH net-next v2 0/2] ipv6: Honor oif when choosing nexthop for locally generated traffic Ido Schimmel 2026-06-01 6:52 ` [PATCH net-next v2 1/2] " Ido Schimmel 2026-06-02 2:51 ` David Ahern 2026-06-02 11:49 ` Ido Schimmel 2026-06-01 6:53 ` [PATCH net-next v2 2/2] selftests: fib_tests: Add test cases for route lookup with oif Ido Schimmel 2026-06-02 2:53 ` David Ahern
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox