summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Weiss <hweiss@users.sourceforge.net>2007-09-24 00:30:14 +0000
committerHolger Weiss <hweiss@users.sourceforge.net>2007-09-24 00:30:14 +0000
commit0b579a345617b0376dc3c30c09316246b9b74525 (patch)
tree111762b4b2e4554c2414221231603a2609452ead
parent6483a72b167906b82e90957e8b962c0994dcde40 (diff)
downloadmonitoring-plugins-0b579a345617b0376dc3c30c09316246b9b74525.tar.gz
Let ./configure --without-ipv6 suppress non-IPv4 DNS lookups (noted by
Mark Frost on nagios-users@) git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1794 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--NEWS1
-rw-r--r--configure.in26
-rw-r--r--plugins/netutils.c4
3 files changed, 23 insertions, 8 deletions
diff --git a/NEWS b/NEWS
index 8b160c8c..ffff548f 100644
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,7 @@ This file documents the major additions and syntax changes between releases.
30 The "negate" utility can now remap custom states 30 The "negate" utility can now remap custom states
31 Check_radius now supports radiusclient-ng 31 Check_radius now supports radiusclient-ng
32 Check_by_ssh now supports multiline output 32 Check_by_ssh now supports multiline output
33 IPv6 support can now be disabled using ./configure --without-ipv6
33 34
341.4.9 4th June 2006 351.4.9 4th June 2006
35 Inclusion of contrib/check_cluster2 as check_cluster with some improvements 36 Inclusion of contrib/check_cluster2 as check_cluster with some improvements
diff --git a/configure.in b/configure.in
index ee928d44..5153b1c2 100644
--- a/configure.in
+++ b/configure.in
@@ -275,9 +275,15 @@ else
275 AC_SUBST(MYSQLCFLAGS) 275 AC_SUBST(MYSQLCFLAGS)
276fi 276fi
277 277
278AC_ARG_WITH([ipv6],
279 [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])],
280 [], [with_ipv6=check])
281
278dnl Check for AF_INET6 support - unistd.h required for Darwin 282dnl Check for AF_INET6 support - unistd.h required for Darwin
279AC_CACHE_CHECK([for IPv6 support], with_ipv6, [ 283if test "$with_ipv6" != "no"; then
280 AC_TRY_COMPILE([#ifdef HAVE_UNISTD_H 284 AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [
285 AC_TRY_COMPILE(
286 [#ifdef HAVE_UNISTD_H
281 #include <unistd.h> 287 #include <unistd.h>
282 #endif 288 #endif
283 #include <netinet/in.h> 289 #include <netinet/in.h>
@@ -288,12 +294,16 @@ AC_CACHE_CHECK([for IPv6 support], with_ipv6, [
288 sin6.sin6_family = AF_INET6; 294 sin6.sin6_family = AF_INET6;
289 sin6.sin6_port = 587; 295 sin6.sin6_port = 587;
290 p = &sin6.sin6_addr;], 296 p = &sin6.sin6_addr;],
291 [with_ipv6=yes], 297 [np_cv_sys_ipv6=yes],
292 [with_ipv6=no]) 298 [np_cv_sys_ipv6=no])
293 ]) 299 ])
294 300 if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then
295if test x"$with_ipv6" != xno ; then 301 AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed])
296 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support]) 302 fi
303 if test "$np_cv_sys_ipv6" = "yes"; then
304 AC_DEFINE(USE_IPV6,1,[Enable IPv6 support])
305 fi
306 with_ipv6="$np_cv_sys_ipv6"
297fi 307fi
298 308
299 309
diff --git a/plugins/netutils.c b/plugins/netutils.c
index e6ffc548..7bf22543 100644
--- a/plugins/netutils.c
+++ b/plugins/netutils.c
@@ -39,7 +39,11 @@
39unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT; 39unsigned int socket_timeout = DEFAULT_SOCKET_TIMEOUT;
40int econn_refuse_state = STATE_CRITICAL; 40int econn_refuse_state = STATE_CRITICAL;
41int was_refused = FALSE; 41int was_refused = FALSE;
42#if USE_IPV6
42int address_family = AF_UNSPEC; 43int address_family = AF_UNSPEC;
44#else
45int address_family = AF_INET;
46#endif
43 47
44/* handles socket timeouts */ 48/* handles socket timeouts */
45void 49void