Merge pull request #139 from abelbeck/fping6

Add backward compatibility for fping6 sym-link

Using sym-links to select IPv6 is discouraged (because it doesn't work the same for IPv4), but I understand that this can help for some use cases (i.e. in particular for the embedded linux distro use case, where having two binaries is an issue). Also, I guess nobody is going to have a binary called fping6 and expect it to do IPv4, so, I guess, no harm done.
pull/145/head
David Schweikert 6 years ago committed by GitHub
commit 6694668fdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -362,6 +362,11 @@ int main(int argc, char** argv)
socket4 = open_ping_socket_ipv4(ping_data_size);
#ifdef IPV6
socket6 = open_ping_socket_ipv6(ping_data_size);
/* if called (sym-linked) via 'fping6', imply '-6'
* for backward compatibility */
if (strstr(prog, "fping6")) {
hints_ai_family = AF_INET6;
}
#endif
if ((uid = getuid())) {

Loading…
Cancel
Save