From a82f40f246162fde9f96fa48b6ea35b37e5b36a4 Mon Sep 17 00:00:00 2001 From: Lonnie Abelbeck Date: Sat, 20 Oct 2018 16:27:39 -0500 Subject: [PATCH] Add backward compatibility for fping6 sym-link --- src/fping.c | 5 +++++ 1 file changed, 5 insertions(+) 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())) {