summaryrefslogtreecommitdiffstats
path: root/ConfigureChecks.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r--ConfigureChecks.cmake42
1 files changed, 40 insertions, 2 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 6cb45d0..d68578f 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -91,8 +91,46 @@ check_prototype_definition(gettimeofday
"sys/time.h"
HAVE_GETTIMEOFDAY_TZ)
-# TODO
-set(HAVE_IPV6 TRUE)
+# IPV6
+check_c_source_compiles("
+ #include <stdlib.h>
+ #include <sys/socket.h>
+ #include <netdb.h>
+ #include <netinet/in.h>
+ #include <net/if.h>
+
+int main(void) {
+ struct sockaddr_storage sa_store;
+ struct addrinfo *ai = NULL;
+ struct in6_addr in6addr;
+ int idx = if_nametoindex(\"iface1\");
+ int s = socket(AF_INET6, SOCK_STREAM, 0);
+ int ret = getaddrinfo(NULL, NULL, NULL, &ai);
+ if (ret != 0) {
+ const char *es = gai_strerror(ret);
+ }
+
+ freeaddrinfo(ai);
+ {
+ int val = 1;
+#ifdef HAVE_LINUX_IPV6_V6ONLY_26
+#define IPV6_V6ONLY 26
+#endif
+ ret = setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY,
+ (const void *)&val, sizeof(val));
+ }
+
+ return 0;
+}" HAVE_IPV6)
+
+check_c_source_compiles("
+#include <sys/socket.h>
+
+int main(void) {
+ struct sockaddr_storage s;
+
+ return 0;
+}" HAVE_SOCKADDR_STORAGE)
# ENDIAN
if (NOT WIN32)