From 825a7322b131a16819b0cacccc186b86fffc57eb Mon Sep 17 00:00:00 2001 From: "Jeremy T. Bouse" Date: Sun, 29 Jun 2003 19:17:27 +0000 Subject: check_ping is now coded with -4 & -6 options to call PING or PING6 command netutils modified to verify hosts based on address_family setting when used with -4 or -6 options. is_inet_addr() will not be tested if -6 is used and is_inet6_addr() will not be tested if -4 is used. Also the is_hostname() will use the address_family value to resolve hostnames only if IPv6 support is available otherwise defaults to AF_INET. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@569 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/netutils.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/netutils.c') diff --git a/plugins/netutils.c b/plugins/netutils.c index dc679e2a..60410c64 100644 --- a/plugins/netutils.c +++ b/plugins/netutils.c @@ -326,11 +326,11 @@ is_host (char *address) int is_addr (char *address) { - if (is_inet_addr (address)) + if (is_inet_addr (address) && address_family != AF_INET6) return (TRUE); #ifdef USE_IPV6 - if (is_inet6_addr (address)) + if (is_inet6_addr (address) && address_family != AF_INET) return (TRUE); #endif @@ -374,7 +374,7 @@ int is_hostname (char *s1) { #ifdef USE_IPV6 - return resolve_host_or_addr (s1, AF_UNSPEC); + return resolve_host_or_addr (s1, address_family); #else return resolve_host_or_addr (s1, AF_INET); #endif -- cgit v1.2.3