Page MenuHomeFreeBSD

ping: add a ping6 hard link for backwards compatibility
ClosedPublic

Authored by asomers on Nov 26 2020, 4:07 PM.

Details

Reviewers
manu
bz
Group Reviewers
manpages
Summary

ping: add a ping6 hard link for backwards compatibility

When invoked as "ping6", ping will now attempt to use ICMPv6 for hostnames
that resolve both IPv4 and IPv6 addresses.

Test Plan

Test case added

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 35053
Build 32029: arc lint + arc unit

Event Timeline

Ignoring the test case (but thanks for adding it) this looks good to me.
Thank you for bringing it back so quickly.

You may or may not merge the two #ifdef INET6 blocks; either way, go ahead please and commit it.

sbin/ping/main.c
76

I wonder if you can merge the two INET6 blocks as

if (strcmp(getprogname(), "ping6") == 0)
   ipv6 = true;
else
   ipv6 = false;
#endif
   ipv4 = false;
This revision is now accepted and ready to land.Nov 26 2020, 4:50 PM