summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-11-09 11:44:16 +0000
committerTon Voon <tonvoon@users.sourceforge.net>2006-11-09 11:44:16 +0000
commitdeadc98264563366726f3698bc57dc1eda13ae75 (patch)
tree8023f193002b6bb5d716df3aeb6053af657d57b7
parenta5a4996a639101859bc183c85b33a6e04f5133f9 (diff)
downloadmonitoring-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
-rw-r--r--CHANGES9
-rw-r--r--THANKS.in1
-rw-r--r--plugins/check_ping.c2
-rw-r--r--plugins/netutils.c10
4 files changed, 15 insertions, 7 deletions
diff --git a/CHANGES b/CHANGES
index 7b1bf9c9..74c5a668 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,14 @@
1This file documents the major additions and syntax changes between releases. 1This file documents the major additions and syntax changes between releases.
2 2
3??
4 Reduced number of DNS lookups in check_ping and netutils.c for IPv6 configurations
5
61.4.6
7 Fixed compile problems with *BSD re: alloca.h
8
91.4.5
10 Fixed bug in perl's is_hostname routine
11
31.4.4 121.4.4
4 New C based check_ntp. The perl version is now deprecated. 13 New C based check_ntp. The perl version is now deprecated.
5 New check_apt plugin 14 New check_apt plugin
diff --git a/THANKS.in b/THANKS.in
index 591ae545..9d880e45 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -200,3 +200,4 @@ Robby Giffin
200Henning Schmiedehausen 200Henning Schmiedehausen
201Markus Baertschi 201Markus Baertschi
202Florian Gleixner 202Florian Gleixner
203Pawel Malachowski
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)
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 a3a241d2..9294f3a2 100644
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
@@ -324,14 +324,12 @@ int
324is_addr (const char *address) 324is_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