Code

Corrections to get code to compile on systems without IPv6 support
authorJeremy T. Bouse <undrgrid@users.sourceforge.net>
Mon, 30 Jun 2003 18:52:38 +0000 (18:52 +0000)
committerJeremy T. Bouse <undrgrid@users.sourceforge.net>
Mon, 30 Jun 2003 18:52:38 +0000 (18:52 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@574 f882894a-f735-0410-b71e-b25c423dba1c

plugins/check_ping.c
plugins/check_ssh.c
plugins/check_tcp.c
plugins/netutils.c

index 0b2afce56e235774142b315d232fd7569c66a77c..06bf8e767440d1d6f28aadf924b22a518e7ddd3e 100644 (file)
@@ -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;
index 421fc01c74df794b9fa51c3096ea31d9999ff862..fba3a862b01614579b7902b74112b471af1e2340 100644 (file)
@@ -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)
index b8af1a1d8699a5a47737be484bd4886a4a6167c7..ce4fd31fda539c71c2f75dfe9c94220e198d48fe 100644 (file)
@@ -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)
index 60410c64345f1759af7790efc23732928190d18c..ea004bb40bafc59409049d2b5af13466d351b50d 100644 (file)
@@ -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