diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-11-09 11:44:16 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-11-09 11:44:16 +0000 |
commit | deadc98264563366726f3698bc57dc1eda13ae75 (patch) | |
tree | 8023f193002b6bb5d716df3aeb6053af657d57b7 /plugins/netutils.c | |
parent | a5a4996a639101859bc183c85b33a6e04f5133f9 (diff) | |
download | monitoring-plugins-deadc98264563366726f3698bc57dc1eda13ae75.tar.gz |
Reduced DNS lookups in check_ping and netutils.c in IPv6 configurations
(Pawel Malachowski)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1535 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/netutils.c')
-rw-r--r-- | plugins/netutils.c | 10 |
1 files changed, 4 insertions, 6 deletions
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 | |||
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 | ||