Hi Collin, On Sat, Jun 29, 2024 at 06:21:37PM -0700, Collin Funk wrote: > While running ping6 to my own IP address I got an error message. This > was because pselect () threw an EINVAL error. > > This was a mistake in my previous change. I thought a condition was part > of the subtraction of two timevals. But it was separate and intended to > check if the timeval was negative before calling select ().
Have you looked if you could add a (regression) test for this? Hm, the ping tests are skipped for me because they need to be run as root. While "ping" works without privileges for me, "ping6" does not. So there are several things we could consider looking into: 1. It would be nice if "ping6" would attempt to fall back to unprivileged ICMP, just as "ping" seems to do. The code in ping/libping.c seems to do the right thing, but I get an error message pertaining to raw sockets instead of "ping6" successfully falling back to an ICMP datagram socket: $ ./ping6 ::1 ./ping6: raw socket: Operation not permitted The "fping" program works for me without privileges for both IPv4 and IPv6 (with the exception of sending to an IPv6 multicast address), so I would expect that "ping6" should generally be able to do this, too. 2. We could consider checking if the tests are running on a system with a Linux kernel. In that case, we could look at the "net.ipv4.ping_group_range" system setting, and check if any of the test process's groups are allowed to use unprivileged ICMP. If this is also true, then we could at least run the IPv4 ping tests. If we fix "ping6" to also support this, then we could also run the IPv6 ping tests. 3. We could check if unprivileged ping works on other operating systems, too, and run the IPv4 (and possibly later also the IPv6) ping tests there. I have read that macOS supports this, but I do not have a Mac to test this on. > I've pushed the attached patch fixing it. Thanks! Br, Erik