diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_ping.c | 2 | ||||
-rw-r--r-- | plugins/netutils.c | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 750b0554..9652ab7f 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c @@ -109,7 +109,7 @@ main (int argc, char **argv) for (i = 0 ; i < n_addresses ; i++) { #ifdef PING6_COMMAND - if (is_inet6_addr(addresses[i]) && address_family != AF_INET) + if (address_family != AF_INET && is_inet6_addr(addresses[i])) rawcmd = strdup(PING6_COMMAND); else rawcmd = strdup(PING_COMMAND); diff --git a/plugins/netutils.c b/plugins/netutils.c index a3a241d2..9294f3a2 100644 --- a/plugins/netutils.c +++ b/plugins/netutils.c @@ -324,14 +324,12 @@ int is_addr (const char *address) { #ifdef USE_IPV6 - if (is_inet_addr (address) && address_family != AF_INET6) + if (address_family == AF_INET && is_inet_addr (address)) + return TRUE; + else if (address_family == AF_INET6 && is_inet6_addr (address)) + return TRUE; #else if (is_inet_addr (address)) -#endif - return (TRUE); - -#ifdef USE_IPV6 - if (is_inet6_addr (address) && address_family != AF_INET) return (TRUE); #endif |