Code

Reduced DNS lookups in check_ping and netutils.c in IPv6 configurations
authorTon Voon <tonvoon@users.sourceforge.net>
Thu, 9 Nov 2006 11:44:16 +0000 (11:44 +0000)
committerTon Voon <tonvoon@users.sourceforge.net>
Thu, 9 Nov 2006 11:44:16 +0000 (11:44 +0000)
(Pawel Malachowski)

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1535 f882894a-f735-0410-b71e-b25c423dba1c

CHANGES
THANKS.in
plugins/check_ping.c
plugins/netutils.c

diff --git a/CHANGES b/CHANGES
index 7b1bf9c955bd191011beb0b3e8a08b38c345b55a..74c5a6686dc9b8a31472a532f6dcc8dca096334b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,14 @@
 This file documents the major additions and syntax changes between releases.
 
+??
+       Reduced number of DNS lookups in check_ping and netutils.c for IPv6 configurations
+
+1.4.6
+       Fixed compile problems with *BSD re: alloca.h
+
+1.4.5
+       Fixed bug in perl's is_hostname routine
+
 1.4.4
        New C based check_ntp. The perl version is now deprecated.
        New check_apt plugin
index 591ae545c509f0418b01aec3dc7f293d6f1f37f5..9d880e4548c4bd704635367136604cb623d9e812 100644 (file)
--- a/THANKS.in
+++ b/THANKS.in
@@ -200,3 +200,4 @@ Robby Giffin
 Henning Schmiedehausen
 Markus Baertschi
 Florian Gleixner
+Pawel Malachowski
index 750b055455610a3bc3c4ccd56c8e0aa5a67ce286..9652ab7fdf44145f4ec88b8aac8c97e651895f64 100644 (file)
@@ -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);
index a3a241d254a81494d8259a33a97ecce851d139a5..9294f3a2101c33a9911f42b30893cd775bbaa578 100644 (file)
@@ -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