Re: [PATCH net-next v4 3/4] selftests: net: test restricted on-link fallback
From: Ido Schimmel
Date: Mon Nov 16 2026 - 04:00:36 EST
On Sun, Nov 15, 2026 at 09:56:39PM +0000, liamsmith827 wrote:
> From: Liam Smith <liamsmith827@xxxxxxxxx>
>
> Following the previous patch, the on-link fallback is no longer taken
> when the FIB lookup hits an unreachable, blackhole or prohibit route/
> rule. Adjust the IPv4 tests accordingly:
>
> 1. ipv4_ping_novrf(): Pinging a loopback address while bound to a
> device now fails with an error instead of timing out, since the lookup
> hits the unreachable default route. Adjust the expected return code.
>
> 2. ipv4_ping_novrf(): Add a variant of the above without the
> unreachable default route, to make sure that the fallback is still
> taken upon a route miss.
>
> 3. ipv4_ping_novrf(): Add a test that demonstrates ping fails as
> expected with an unreachable rule. This ensures FIB_LOOKUP_REPORT_MISS
> does not break this behavior.
>
> 4. ipv4_ping_novrf(): Enable the device bind test cases that were
> commented out because of the fallback (prohibit rule, unreachable route
> and unreachable default route).
>
> 5. ipv4_udp_novrf(): Connecting to a loopback address while bound to a
> device now fails with an error instead of timing out. Adjust the
> expected return code.
>
> With the exception of the route miss and unreachable ping test cases,
> which are specific to IPv4, the IPv4 test cases are now aligned with
> their IPv6 counterparts.
>
> Signed-off-by: Liam Smith <liamsmith827@xxxxxxxxx>
# ./fcnal-test.sh -t ipv4_ping
[...]
Tests passed: 122
Tests failed: 3
Don't submit tests without running them.
Needs:
diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
index 9722d7dcad08..7d51fdcc8fda 100755
--- a/tools/testing/selftests/net/fcnal-test.sh
+++ b/tools/testing/selftests/net/fcnal-test.sh
@@ -658,7 +658,8 @@ ipv4_ping_novrf()
log_start
setup_cmd ip rule add pref 49 to ${NSB_LO_IP} unreachable
- log_test_addr ${a} $? 2 "ping out, blocked by unreachable rule"
+ run_cmd ping -c1 -w1 -I ${NSA_DEV} ${a}
+ log_test_addr ${a} $? 2 "ping out, device bind, blocked by unreachable rule"
setup_cmd ip rule del pref 49 to ${NSB_LO_IP} unreachable
log_start