Kaynağa Gözat

Corrections to get code to compile on systems without IPv6 support

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@574 f882894a-f735-0410-b71e-b25c423dba1c
Jeremy T. Bouse 22 yıl önce
ebeveyn
işleme
97634d8fc6
4 değiştirilmiş dosya ile 16 ekleme ve 0 silme
  1. 4 0
      plugins/check_ping.c
  2. 4 0
      plugins/check_ssh.c
  3. 4 0
      plugins/check_tcp.c
  4. 4 0
      plugins/netutils.c

+ 4 - 0
plugins/check_ping.c

@@ -227,7 +227,11 @@ process_arguments (int argc, char **argv)
 			address_family = AF_INET;
 			break;
 		case '6':	/* IPv6 only */
+#ifdef USE_IPV6
 			address_family = AF_INET6;
+#else
+			usage ("IPv6 support not available\n");
+#endif
 			break;
 		case 'H':	/* hostname */
 			ptr=optarg;

+ 4 - 0
plugins/check_ssh.c

@@ -110,7 +110,11 @@ process_arguments (int argc, char **argv)
 			address_family = AF_INET;
 			break;
 		case '6':
+#ifdef USE_IPV6
 			address_family = AF_INET6;
+#else
+			usage ("IPv6 support not available\n");
+#endif
 			break;
 		case 'H':									/* host */
 			if (is_host (optarg) == FALSE)

+ 4 - 0
plugins/check_tcp.c

@@ -449,7 +449,11 @@ process_arguments (int argc, char **argv)
 			address_family = AF_INET;
 			break;
 		case '6':
+#ifdef USE_IPV6
 			address_family = AF_INET6;
+#else
+			usage ("IPv6 support not available\n");
+#endif
 			break;
 		case 'H':                 /* hostname */
 			if (is_host (optarg) == FALSE)

+ 4 - 0
plugins/netutils.c

@@ -326,7 +326,11 @@ is_host (char *address)
 int
 is_addr (char *address)
 {
+#ifdef USE_IPV6
 	if (is_inet_addr (address) && address_family != AF_INET6)
+#else
+	if (is_inet_addr (address))
+#endif
 		return (TRUE);
 
 #ifdef USE_IPV6