summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9d7f91d)
raw | patch | inline | side by side (parent: 9d7f91d)
author | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | |
Wed, 7 May 2003 18:01:32 +0000 (18:01 +0000) | ||
committer | Jeremy T. Bouse <undrgrid@users.sourceforge.net> | |
Wed, 7 May 2003 18:01:32 +0000 (18:01 +0000) |
PING6_COMMAND determined during the configure script execution. As
USE_IPV6 may be defined and PING6_COMMAND is not defined if there is not
IPv6 TCP stack available when configure is run I condition it off
PING6_COMMAND existing to remove build errors for being undefined.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@500 f882894a-f735-0410-b71e-b25c423dba1c
USE_IPV6 may be defined and PING6_COMMAND is not defined if there is not
IPv6 TCP stack available when configure is run I condition it off
PING6_COMMAND existing to remove build errors for being undefined.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@500 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_ping.c | patch | blob | history |
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index 2526a74f451aa8037fae927d5fb0093e856890a6..54402ae3a2202ccb9032836e728cfb7976b713ea 100644 (file)
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
for (i = 0 ; i < n_addresses ; i++) {
/* does the host address of number of packets argument come first? */
-#ifdef PING_PACKETS_FIRST
+#ifdef PING6_COMMAND
+# ifdef PING_PACKETS_FIRST
+ if (is_inet6_addr(addresses[i]))
+ asprintf (&command_line, PING6_COMMAND, max_packets, addresses[i]);
+ else
+ asprintf (&command_line, PING_COMMAND, max_packets, addresses[i]);
+# else
+ if (is_inet6_addr(addresses[i]))
+ asprintf (&command_line, PING6_COMMAND, addresses[i], max_packets);
+ else
+ asprintf (&command_line, PING_COMMAND, addresses[i], max_packets);
+# endif
+#else /* USE_IPV6 */
+# ifdef PING_PACKETS_FIRST
asprintf (&command_line, PING_COMMAND, max_packets, addresses[i]);
-#else
+# else
asprintf (&command_line, PING_COMMAND, addresses[i], max_packets);
-#endif
+# endif
+#endif /* USE_IPV6 */
if (verbose)
printf ("%s ==> ", command_line);