From: Lonnie Abelbeck Date: Sat, 20 Oct 2018 21:27:39 +0000 (-0500) Subject: Add backward compatibility for fping6 sym-link X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a82f40f246162fde9f96fa48b6ea35b37e5b36a4;p=fping.git Add backward compatibility for fping6 sym-link --- diff --git a/src/fping.c b/src/fping.c index a4e45a1..7012edb 100644 --- a/src/fping.c +++ b/src/fping.c @@ -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())) {