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 750b055..9652ab7 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c | |||
@@ -109,7 +109,7 @@ main (int argc, char **argv) | |||
109 | for (i = 0 ; i < n_addresses ; i++) { | 109 | for (i = 0 ; i < n_addresses ; i++) { |
110 | 110 | ||
111 | #ifdef PING6_COMMAND | 111 | #ifdef PING6_COMMAND |
112 | if (is_inet6_addr(addresses[i]) && address_family != AF_INET) | 112 | if (address_family != AF_INET && is_inet6_addr(addresses[i])) |
113 | rawcmd = strdup(PING6_COMMAND); | 113 | rawcmd = strdup(PING6_COMMAND); |
114 | else | 114 | else |
115 | rawcmd = strdup(PING_COMMAND); | 115 | rawcmd = strdup(PING_COMMAND); |
diff --git a/plugins/netutils.c b/plugins/netutils.c index a3a241d..9294f3a 100644 --- a/plugins/netutils.c +++ b/plugins/netutils.c | |||
@@ -324,14 +324,12 @@ int | |||
324 | is_addr (const char *address) | 324 | is_addr (const char *address) |
325 | { | 325 | { |
326 | #ifdef USE_IPV6 | 326 | #ifdef USE_IPV6 |
327 | if (is_inet_addr (address) && address_family != AF_INET6) | 327 | if (address_family == AF_INET && is_inet_addr (address)) |
328 | return TRUE; | ||
329 | else if (address_family == AF_INET6 && is_inet6_addr (address)) | ||
330 | return TRUE; | ||
328 | #else | 331 | #else |
329 | if (is_inet_addr (address)) | 332 | if (is_inet_addr (address)) |
330 | #endif | ||
331 | return (TRUE); | ||
332 | |||
333 | #ifdef USE_IPV6 | ||
334 | if (is_inet6_addr (address) && address_family != AF_INET) | ||
335 | return (TRUE); | 333 | return (TRUE); |
336 | #endif | 334 | #endif |
337 | 335 | ||