From: Lonnie Abelbeck Date: Sun, 21 Oct 2018 13:47:44 +0000 (-0500) Subject: Fix hang with '-6', with ipv6 kernel module, but not loaded X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03e050a395415ce079efb64848533dc6a3e37bb3;p=fping.git Fix hang with '-6', with ipv6 kernel module, but not loaded --- diff --git a/src/fping.c b/src/fping.c index a4e45a1..f215a70 100644 --- a/src/fping.c +++ b/src/fping.c @@ -687,11 +687,11 @@ int main(int argc, char** argv) /* validate various option settings */ - if (socket4 < 0 -#ifdef IPV6 - && socket6 < 0 +#ifndef IPV6 + if (socket4 < 0) { +#else + if ((socket4 < 0 && socket6 < 0) || (hints_ai_family == AF_INET6 && socket6 < 0)) { #endif - ) { crash_and_burn("can't create socket (must run as root?)"); }