diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-04-03 00:54:52 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-04-03 00:54:52 -0700 |
commit | 54463affafd73608b4065794d26d8edd705fb4ca (patch) | |
tree | 5be6090392b075458f78c5767f5a5c01d5d18d9b | |
parent | 8b71f48f7bbf65ce6b5330a42bb71d2bd0ec45ee (diff) | |
download | xrdp-proprietary-54463affafd73608b4065794d26d8edd705fb4ca.tar.gz xrdp-proprietary-54463affafd73608b4065794d26d8edd705fb4ca.zip |
autodetect ipv6
-rw-r--r-- | common/os_calls.c | 6 | ||||
-rw-r--r-- | configure.ac | 5 |
2 files changed, 8 insertions, 3 deletions
diff --git a/common/os_calls.c b/common/os_calls.c index 8023e1f0..278cc8cc 100644 --- a/common/os_calls.c +++ b/common/os_calls.c @@ -439,7 +439,7 @@ g_tcp_socket(void) unsigned int option_len; #endif -#if defined(XRDP_ENABLE_IPv6) +#if !defined(NO_ARPA_INET_H_IP6) rv = (int)socket(AF_INET6, SOCK_STREAM, 0); #else rv = (int)socket(AF_INET, SOCK_STREAM, 0); @@ -448,7 +448,7 @@ g_tcp_socket(void) { return -1; } -#if defined(XRDP_ENABLE_IPv6) +#if !defined(NO_ARPA_INET_H_IP6) option_len = sizeof(option_value); if (getsockopt(rv, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&option_value, &option_len) == 0) @@ -542,7 +542,7 @@ g_tcp_connect(int sck, const char *address, const char *port) * available IPv4-mapped addresses in case the target * host does not have a true IPv6 address: */ -#ifdef _XRDP_ENABLE_IPv6_ +#if !defined(NO_ARPA_INET_H_IP6) p.ai_flags = AI_ADDRCONFIG | AI_V4MAPPED; p.ai_family = AF_INET6; #else diff --git a/configure.ac b/configure.ac index d4315133..115c3aa6 100644 --- a/configure.ac +++ b/configure.ac @@ -69,6 +69,11 @@ then fi fi +AC_CHECK_MEMBER([struct in6_addr.s6_addr], + [], + [AC_DEFINE(NO_ARPA_INET_H_IP6, 1, [for IPv6])], + [#include <arpa/inet.h>]) + if test "x$enable_nopam" = "xyes" then AC_DEFINE([USE_NOPAM],1,[Disable PAM]) |