Re: [PATCH bpf-next] selftests/bpf: Use ping_command() for IPv6 pings in lwt_ip_encap

[email protected]
Newsgroups org.kernel.vger.bpf
Message-ID <21ab42ec09540abb9ae0f130095ac5bab6d59b2254467f6dfdc193de31f53c17@mail.kernel.org>
> commit 0717c3442da506b8360051a6f87406ecc25dde4c
> Author: Andrii Nakryiko <[email protected]>
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.