]> git.gsnw.org Git - fping.git/commitdiff
Add backward compatibility for fping6 sym-link
authorLonnie Abelbeck <lonnie@abelbeck.com>
Sat, 20 Oct 2018 21:27:39 +0000 (16:27 -0500)
committerLonnie Abelbeck <lonnie@abelbeck.com>
Sat, 20 Oct 2018 21:27:39 +0000 (16:27 -0500)
src/fping.c

index a4e45a1c49a19ac88255f804908d1f1b2d244095..7012edb8fad882fd543cf8f13f6669de36558342 100644 (file)
@@ -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())) {