summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-28 21:36:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:04:56 -0500
commit148f07c94b885412250bba7d955c423adac2e5b9 (patch)
tree28975f56d37aeb3f540ff866ee1c8e24b0c6ee22 /source4/lib
parent66790e49a237460b0d4862c9f4f64ce8e551f37f (diff)
downloadsamba-148f07c94b885412250bba7d955c423adac2e5b9.tar.gz
samba-148f07c94b885412250bba7d955c423adac2e5b9.tar.bz2
samba-148f07c94b885412250bba7d955c423adac2e5b9.zip
r3333: added configure tests for ipv6 support
(This used to be commit 9794570c6d0646cc34147bf8128802b181f658f0)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/socket/config.m47
-rw-r--r--source4/lib/socket/socket.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/source4/lib/socket/config.m4 b/source4/lib/socket/config.m4
index 588bf9064e..8c4a9fe40c 100644
--- a/source4/lib/socket/config.m4
+++ b/source4/lib/socket/config.m4
@@ -1,6 +1,11 @@
SMB_MODULE_MK(socket_ipv4,SOCKET,STATIC,lib/socket/config.mk)
-SMB_MODULE_MK(socket_ipv6,SOCKET,STATIC,lib/socket/config.mk)
SMB_MODULE_MK(socket_unix,SOCKET,STATIC,lib/socket/config.mk)
+AC_CHECK_FUNCS(gethostbyname2, have_ipv6=true, have_ipv6=false)
+if $have_ipv6 = true; then
+ AC_DEFINE(HAVE_SOCKET_IPV6,1,[Whether the system has ipv6 support])
+ SMB_MODULE_MK(socket_ipv6,SOCKET,STATIC,lib/socket/config.mk)
+fi
+
SMB_SUBSYSTEM_MK(SOCKET,lib/socket/config.mk)
diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c
index c3cacbebd8..84bb1ccafe 100644
--- a/source4/lib/socket/socket.c
+++ b/source4/lib/socket/socket.c
@@ -267,9 +267,11 @@ const struct socket_ops *socket_getops_byname(const char *name, enum socket_type
return socket_ipv4_ops();
}
+#if HAVE_SOCKET_IPV6
if (strcmp("ipv6", name) == 0) {
return socket_ipv6_ops();
}
+#endif
if (strcmp("unix", name) == 0) {
return socket_unixdom_ops();