* [PATCH bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap
@ 2026-08-13 21:35 Andrii Nakryiko
2026-08-13 21:38 ` Song Liu
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2026-08-13 21:35 UTC (permalink / raw)
To: bpf; +Cc: andrii, kernel-team
lwt_ip_encap hardcodes the ping6 binary for its IPv6 pings. iputils
merged ping6 into ping long ago and distros have started dropping the
compat symlink -- Arch's iputils 20250605 ships only arping, clockdiff,
ping and tracepath. There, every lwt_ip_encap subtest fails:
check_ping_ok:FAIL:ip netns exec ns-lwt-ip-encap-1-0101330 ping6 -c 1 \
-W1 -I veth1 fb04::1 > /dev/null unexpected error: 256 (errno 2)
#217/1 lwt_ip_encap_ipv4/egress:FAIL
The IPv4 subtests fail too, because check_ping_ok() pings both families.
SYS() runs the command through system(), so a missing binary is
indistinguishable from an unreachable peer.
network_helpers.c has had ping_command() for exactly this since commit
372642ea83ff ("selftests/bpf: Move netcnt test under test_progs"): it
falls back to "ping -6" when ping6 is not present. lwt_ip_encap.c is the
last hardcoded ping6 user. Fix that.
Fixes: f5e288943e2c ("selftests/bpf: Move test_lwt_ip_encap to test_progs")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
---
tools/testing/selftests/bpf/prog_tests/lwt_ip_encap.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/lwt_ip_encap.c b/tools/testing/selftests/bpf/prog_tests/lwt_ip_encap.c
index 6606f0ed9a9a..39e8a3b8b6af 100644
--- a/tools/testing/selftests/bpf/prog_tests/lwt_ip_encap.c
+++ b/tools/testing/selftests/bpf/prog_tests/lwt_ip_encap.c
@@ -410,7 +410,8 @@ static int test_gso_fix(const char *ns1, const char *ns3, int family)
static int check_ping_ok(const char *ns1)
{
SYS(fail, "ip netns exec %s ping -c 1 -W1 -I veth1 %s > /dev/null", ns1, IP4_ADDR_DST);
- SYS(fail, "ip netns exec %s ping6 -c 1 -W1 -I veth1 %s > /dev/null", ns1, IP6_ADDR_DST);
+ SYS(fail, "ip netns exec %s %s -c 1 -W1 -I veth1 %s > /dev/null", ns1,
+ ping_command(AF_INET6), IP6_ADDR_DST);
return 0;
fail:
return -1;
@@ -424,7 +425,8 @@ static int check_ping_fails(const char *ns1)
if (!ret)
return -1;
- ret = SYS_NOFAIL("ip netns exec %s ping6 -c 1 -W1 -I veth1 %s", ns1, IP6_ADDR_DST);
+ ret = SYS_NOFAIL("ip netns exec %s %s -c 1 -W1 -I veth1 %s", ns1,
+ ping_command(AF_INET6), IP6_ADDR_DST);
if (!ret)
return -1;
@@ -657,9 +659,10 @@ static void lwt_ip_encap_vxlan(bool ipv4_encap)
skel->bss->fexit_triggered = false;
if (ipv4_encap)
- SYS(out, "ip netns exec %s ping -c 1 -W1 %s", ns1, IP4_ADDR_DST);
+ SYS(out, "ip netns exec %s ping -c 1 -W1 %s", ns1, IP4_ADDR_DST);
else
- SYS(out, "ip netns exec %s ping6 -c 1 -W1 %s", ns1, IP6_ADDR_DST);
+ SYS(out, "ip netns exec %s %s -c 1 -W1 %s", ns1,
+ ping_command(AF_INET6), IP6_ADDR_DST);
if (!ASSERT_TRUE(skel->bss->fexit_triggered, "fexit_triggered"))
goto out;
--
2.53.0-Meta
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap
2026-08-13 21:35 [PATCH bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap Andrii Nakryiko
@ 2026-08-13 21:38 ` Song Liu
2026-08-13 22:41 ` bot+bpf-ci
2026-08-14 16:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Song Liu @ 2026-08-13 21:38 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: bpf, kernel-team
On Thu, Aug 13, 2026 at 2:36 PM 'Andrii Nakryiko' via Kernel Team
<kernel-team@meta.com> wrote:
>
> lwt_ip_encap hardcodes the ping6 binary for its IPv6 pings. iputils
> merged ping6 into ping long ago and distros have started dropping the
> compat symlink -- Arch's iputils 20250605 ships only arping, clockdiff,
> ping and tracepath. There, every lwt_ip_encap subtest fails:
>
> check_ping_ok:FAIL:ip netns exec ns-lwt-ip-encap-1-0101330 ping6 -c 1 \
> -W1 -I veth1 fb04::1 > /dev/null unexpected error: 256 (errno 2)
> #217/1 lwt_ip_encap_ipv4/egress:FAIL
>
> The IPv4 subtests fail too, because check_ping_ok() pings both families.
> SYS() runs the command through system(), so a missing binary is
> indistinguishable from an unreachable peer.
>
> network_helpers.c has had ping_command() for exactly this since commit
> 372642ea83ff ("selftests/bpf: Move netcnt test under test_progs"): it
> falls back to "ping -6" when ping6 is not present. lwt_ip_encap.c is the
> last hardcoded ping6 user. Fix that.
>
> Fixes: f5e288943e2c ("selftests/bpf: Move test_lwt_ip_encap to test_progs")
> Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <song@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap
2026-08-13 21:35 [PATCH bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap Andrii Nakryiko
2026-08-13 21:38 ` Song Liu
@ 2026-08-13 22:41 ` bot+bpf-ci
2026-08-14 16:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: bot+bpf-ci @ 2026-08-13 22:41 UTC (permalink / raw)
To: andrii, bpf
Cc: andrii, kernel-team, ast, andrii, daniel, martin.lau, eddyz87,
yonghong.song, clm, ihor.solodrai
[-- Attachment #1: Type: text/plain, Size: 1888 bytes --]
> commit 0717c3442da506b8360051a6f87406ecc25dde4c
> Author: Andrii Nakryiko <andrii@kernel.org>
> Date: Thu Aug 13 14:35:58 2026 -0700
>
> selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap
>
> lwt_ip_encap hardcodes the ping6 binary for its IPv6 pings. iputils
> merged ping6 into ping long ago and distros have started dropping the
> compat symlink -- Arch's iputils 20250605 ships only arping, clockdiff,
> ping and tracepath. There, every lwt_ip_encap subtest fails:
>
> check_ping_ok:FAIL:ip netns exec ns-lwt-ip-encap-1-0101330 ping6 -c 1 \
> -W1 -I veth1 fb04::1 > /dev/null unexpected error: 256 (errno 2)
> #217/1 lwt_ip_encap_ipv4/egress:FAIL
The sentence "every lwt_ip_encap subtest fails" isn't quite accurate.
Looking at test_lwt_ip_encap_vxlan_ipv4() in the patched code, it calls
lwt_ip_encap_vxlan(IPV4_ENCAP), which only ever runs the IPv4 arm:
if (ipv4_encap)
SYS(out, "ip netns exec %s ping -c 1 -W1 %s", ns1, IP4_ADDR_DST);
else
SYS(out, "ip netns exec %s %s -c 1 -W1 %s", ns1,
ping_command(AF_INET6), IP6_ADDR_DST);
This path never touches ping6 or ping_command(), so the
test_lwt_ip_encap_vxlan_ipv4 subtest passes on a ping6-less host both
before and after this patch.
The other 9 subtests do fail: lwt_ip_encap_ipv4/{egress,ingress},
lwt_ip_encap_ipv6/{egress,ingress}, lwt_ip_encap_vrf_ipv4/{egress,ingress},
lwt_ip_encap_vrf_ipv6/{egress,ingress}, and lwt_ip_encap_vxlan_ipv6.
Would it be more accurate to say "every subtest that pings over IPv6 fails"
so the reproducer description matches the code behavior?
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/31747915907
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: [PATCH bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap
2026-08-13 21:35 [PATCH bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap Andrii Nakryiko
2026-08-13 21:38 ` Song Liu
2026-08-13 22:41 ` bot+bpf-ci
@ 2026-08-14 16:30 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-08-14 16:30 UTC (permalink / raw)
To: Andrii Nakryiko; +Cc: bpf, kernel-team
Hello:
This patch was applied to bpf/bpf-next.git (master)
by Daniel Borkmann <daniel@iogearbox.net>:
On Thu, 13 Aug 2026 14:35:58 -0700 you wrote:
> lwt_ip_encap hardcodes the ping6 binary for its IPv6 pings. iputils
> merged ping6 into ping long ago and distros have started dropping the
> compat symlink -- Arch's iputils 20250605 ships only arping, clockdiff,
> ping and tracepath. There, every lwt_ip_encap subtest fails:
>
> check_ping_ok:FAIL:ip netns exec ns-lwt-ip-encap-1-0101330 ping6 -c 1 \
> -W1 -I veth1 fb04::1 > /dev/null unexpected error: 256 (errno 2)
> #217/1 lwt_ip_encap_ipv4/egress:FAIL
>
> [...]
Here is the summary with links:
- [bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap
https://git.kernel.org/bpf/bpf-next/c/073574da7a8e
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-08-14 16:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-13 21:35 [PATCH bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap Andrii Nakryiko
2026-08-13 21:38 ` Song Liu
2026-08-13 22:41 ` bot+bpf-ci
2026-08-14 16:30 ` patchwork-bot+netdevbpf
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.