* [PATCH net-next] selftests: icmp_redirect: remove xfail support
@ 2026-09-07 13:24 Eric Dumazet
2026-09-07 15:37 ` Ido Schimmel
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2026-09-07 13:24 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, David Ahern, Ido Schimmel, netdev, eric.dumazet,
Eric Dumazet
Commit 0a36a75c6818 ("selftests: icmp_redirect: support expected failures")
added xfail support to icmp_redirect.sh because IPv6 redirect tests
(including the VRF variants) were failing due to bugs in the IPv6
redirect logic.
Part of this was addressed in commit 0e02bf5de46a ("selftests:
icmp_redirect: IPv6 PMTU info should be cleared after redirect"), which
updated the test expectation that old PMTU information should be
cleared following a redirect.
Recently, commit cd51b74bdd0b ("ipv6: Fix redirect exception creation for
UDP/RAW sockets") fixed the underlying kernel bug in ip6_sk_redirect():
previously, passing sk->sk_bound_dev_if caused exception creation to
fail for sockets not bound to a device or bound to a VRF. Now that
skb->dev->ifindex is used, redirect exceptions are created properly for
UDP and RAW sockets, including in VRF environments.
With this fix in place, all IPv6 tests in icmp_redirect.sh pass as
expected. Passing xfail=1 to log_test() for all IPv6 tests is no longer
necessary and masks unexpected failures as XFAIL instead of FAIL.
Commit 3748939bce3f ("selftests: icmp_redirect: pass xfail=0 to log_test()")
worked around a bash error caused by empty xfail arguments on IPv4 tests.
Remove the obsolete xfail support from log_test() and restore standard
pass/fail reporting across all tests.
Tested:
Tests passed: 40
Tests failed: 0
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
tools/testing/selftests/net/icmp_redirect.sh | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/net/icmp_redirect.sh b/tools/testing/selftests/net/icmp_redirect.sh
index b13c89a99ecbaa37638c39b12818d2d59a97ec50..35357d02e823bcad7106cd7d628824d1787af4e7 100755
--- a/tools/testing/selftests/net/icmp_redirect.sh
+++ b/tools/testing/selftests/net/icmp_redirect.sh
@@ -64,14 +64,10 @@ log_test()
local rc=$1
local expected=$2
local msg="$3"
- local xfail=$4
if [ ${rc} -eq ${expected} ]; then
printf "TEST: %-60s [ OK ]\n" "${msg}"
nsuccess=$((nsuccess+1))
- elif [ ${rc} -eq ${xfail} ]; then
- printf "TEST: %-60s [XFAIL]\n" "${msg}"
- nxfail=$((nxfail+1))
else
ret=1
nfail=$((nfail+1))
@@ -303,7 +299,7 @@ check_exception()
ip -netns $h1 ro get ${H1_VRF_ARG} ${H2_N2_IP} | \
grep -E -v 'mtu|redirected' | grep -q "cache"
fi
- log_test $? 0 "IPv4: ${desc}" 0
+ log_test $? 0 "IPv4: ${desc}"
# No PMTU info for test "redirect" and "mtu exception plus redirect"
if [ "$with_redirect" = "yes" ] && [ "$desc" != "redirect exception plus mtu" ]; then
@@ -319,7 +315,7 @@ check_exception()
ip -netns $h1 -6 ro get ${H1_VRF_ARG} ${H2_N2_IP6} | \
grep -v "mtu" | grep -q "${R1_LLADDR}"
fi
- log_test $? 0 "IPv6: ${desc}" 1
+ log_test $? 0 "IPv6: ${desc}"
}
run_ping()
@@ -485,7 +481,6 @@ which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
ret=0
nsuccess=0
nfail=0
-nxfail=0
while getopts :pv o
do
@@ -530,6 +525,5 @@ fi
printf "\nTests passed: %3d\n" ${nsuccess}
printf "Tests failed: %3d\n" ${nfail}
-printf "Tests xfailed: %3d\n" ${nxfail}
exit $ret
--
2.55.0.979.g7e5102b832-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net-next] selftests: icmp_redirect: remove xfail support
2026-09-07 13:24 [PATCH net-next] selftests: icmp_redirect: remove xfail support Eric Dumazet
@ 2026-09-07 15:37 ` Ido Schimmel
2026-09-07 15:52 ` Eric Dumazet
0 siblings, 1 reply; 4+ messages in thread
From: Ido Schimmel @ 2026-09-07 15:37 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
David Ahern, netdev, eric.dumazet
On Mon, Sep 07, 2026 at 01:24:23PM +0000, Eric Dumazet wrote:
> Commit 0a36a75c6818 ("selftests: icmp_redirect: support expected failures")
> added xfail support to icmp_redirect.sh because IPv6 redirect tests
> (including the VRF variants) were failing due to bugs in the IPv6
> redirect logic.
>
> Part of this was addressed in commit 0e02bf5de46a ("selftests:
> icmp_redirect: IPv6 PMTU info should be cleared after redirect"), which
> updated the test expectation that old PMTU information should be
> cleared following a redirect.
>
> Recently, commit cd51b74bdd0b ("ipv6: Fix redirect exception creation for
> UDP/RAW sockets") fixed the underlying kernel bug in ip6_sk_redirect():
> previously, passing sk->sk_bound_dev_if caused exception creation to
> fail for sockets not bound to a device or bound to a VRF. Now that
> skb->dev->ifindex is used, redirect exceptions are created properly for
> UDP and RAW sockets, including in VRF environments.
>
> With this fix in place, all IPv6 tests in icmp_redirect.sh pass as
> expected. Passing xfail=1 to log_test() for all IPv6 tests is no longer
> necessary and masks unexpected failures as XFAIL instead of FAIL.
>
> Commit 3748939bce3f ("selftests: icmp_redirect: pass xfail=0 to log_test()")
> worked around a bash error caused by empty xfail arguments on IPv4 tests.
>
> Remove the obsolete xfail support from log_test() and restore standard
> pass/fail reporting across all tests.
>
> Tested:
> Tests passed: 40
> Tests failed: 0
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
FTR, I don't think cd51b74bdd0b ("ipv6: Fix redirect exception creation
for UDP/RAW sockets") is what fixed the xfail (I never saw xfail, even
before my patch). It's more likely that it was fixed by commit
0e02bf5de46a ("selftests: icmp_redirect: IPv6 PMTU info should be
cleared after redirect"):
1. The redirect message quotes an echo request, so it's going through
icmpv6_err() which calls ip6_redirect() using the correct oif. It's
possible that rawv6_err() later called ip6_sk_redirect(), but by then
the exception was already present / populated.
2. Both 0e02bf5de46a and 0a36a75c6818 mention the same test case: "mtu
exception plus redirect".
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net-next] selftests: icmp_redirect: remove xfail support
2026-09-07 15:37 ` Ido Schimmel
@ 2026-09-07 15:52 ` Eric Dumazet
2026-09-08 2:40 ` Hangbin Liu
0 siblings, 1 reply; 4+ messages in thread
From: Eric Dumazet @ 2026-09-07 15:52 UTC (permalink / raw)
To: Ido Schimmel
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
David Ahern, netdev, eric.dumazet
On Mon, Sep 7, 2026 at 5:37 PM Ido Schimmel <idosch@nvidia.com> wrote:
> Reviewed-by: Ido Schimmel <idosch@nvidia.com>
>
> FTR, I don't think cd51b74bdd0b ("ipv6: Fix redirect exception creation
> for UDP/RAW sockets") is what fixed the xfail (I never saw xfail, even
> before my patch). It's more likely that it was fixed by commit
> 0e02bf5de46a ("selftests: icmp_redirect: IPv6 PMTU info should be
> cleared after redirect"):
>
> 1. The redirect message quotes an echo request, so it's going through
> icmpv6_err() which calls ip6_redirect() using the correct oif. It's
> possible that rawv6_err() later called ip6_sk_redirect(), but by then
> the exception was already present / populated.
Ah right, I will send a V2 with an updated changelog, thanks!
pw-bot: cr
>
> 2. Both 0e02bf5de46a and 0a36a75c6818 mention the same test case: "mtu
> exception plus redirect".
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH net-next] selftests: icmp_redirect: remove xfail support
2026-09-07 15:52 ` Eric Dumazet
@ 2026-09-08 2:40 ` Hangbin Liu
0 siblings, 0 replies; 4+ messages in thread
From: Hangbin Liu @ 2026-09-08 2:40 UTC (permalink / raw)
To: Eric Dumazet
Cc: Ido Schimmel, David S . Miller, Jakub Kicinski, Paolo Abeni,
Simon Horman, David Ahern, netdev, eric.dumazet
On Mon, Sep 07, 2026 at 05:52:13PM +0200, Eric Dumazet wrote:
> On Mon, Sep 7, 2026 at 5:37 PM Ido Schimmel <idosch@nvidia.com> wrote:
>
> > Reviewed-by: Ido Schimmel <idosch@nvidia.com>
> >
> > FTR, I don't think cd51b74bdd0b ("ipv6: Fix redirect exception creation
> > for UDP/RAW sockets") is what fixed the xfail (I never saw xfail, even
> > before my patch). It's more likely that it was fixed by commit
> > 0e02bf5de46a ("selftests: icmp_redirect: IPv6 PMTU info should be
> > cleared after redirect"):
> >
> > 1. The redirect message quotes an echo request, so it's going through
> > icmpv6_err() which calls ip6_redirect() using the correct oif. It's
> > possible that rawv6_err() later called ip6_sk_redirect(), but by then
> > the exception was already present / populated.
>
> Ah right, I will send a V2 with an updated changelog, thanks!
Good, I will rebase my log_test() cleanup on your patch.
Thanks
Hangbin
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-09-08 2:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 13:24 [PATCH net-next] selftests: icmp_redirect: remove xfail support Eric Dumazet
2026-09-07 15:37 ` Ido Schimmel
2026-09-07 15:52 ` Eric Dumazet
2026-09-08 2:40 ` Hangbin Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).