Page MenuHomeFreeBSD

ping: add a ping6 hard link for backwards compatibility
ClosedPublic

Authored by asomers on Nov 26 2020, 4:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 3:32 PM
Unknown Object (File)
Fri, Apr 5, 2:17 AM
Unknown Object (File)
Feb 23 2024, 10:21 AM
Unknown Object (File)
Feb 23 2024, 10:21 AM
Unknown Object (File)
Feb 23 2024, 10:07 AM
Unknown Object (File)
Jan 6 2024, 10:24 AM
Unknown Object (File)
Dec 25 2023, 9:05 AM
Unknown Object (File)
Dec 20 2023, 6:30 AM
Subscribers

Details

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 Passed
Unit
No 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