[Nagiosplug-checkins] nagiosplug/plugins check_ping.c, 1.52, 1.53 netutils.c, 1.31, 1.32

Ton Voon tonvoon at users.sourceforge.net
Thu Nov 9 12:44:18 CET 2006


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv8006/plugins

Modified Files:
	check_ping.c netutils.c 
Log Message:
Reduced DNS lookups in check_ping and netutils.c in IPv6 configurations 
(Pawel Malachowski)


Index: check_ping.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_ping.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- check_ping.c	19 Oct 2006 00:25:16 -0000	1.52
+++ check_ping.c	9 Nov 2006 11:44:16 -0000	1.53
@@ -109,7 +109,7 @@
 	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: netutils.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/netutils.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- netutils.c	18 Jun 2006 19:36:48 -0000	1.31
+++ netutils.c	9 Nov 2006 11:44:16 -0000	1.32
@@ -324,14 +324,12 @@
 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
 





More information about the Commits mailing list