aboutsummaryrefslogtreecommitdiff
path: root/plugins/netutils.c
diff options
context:
space:
mode:
authorGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-06-29 19:17:27 +0000
committerGravatar Jeremy T. Bouse <undrgrid@users.sourceforge.net> 2003-06-29 19:17:27 +0000
commit825a7322b131a16819b0cacccc186b86fffc57eb (patch)
tree94311e40058eb5e25321575bd9dd9f9b0c863952 /plugins/netutils.c
parentd77d183ddb8bdff5069ba5fa008406087162d117 (diff)
downloadmonitoring-plugins-825a7322b131a16819b0cacccc186b86fffc57eb.tar.gz
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
Diffstat (limited to 'plugins/netutils.c')
-rw-r--r--plugins/netutils.c6
1 files changed, 3 insertions, 3 deletions
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