Skip to content

Commit

Permalink
autodetect ipv6
Browse files Browse the repository at this point in the history
  • Loading branch information
jsorg71 committed Apr 3, 2013
1 parent 8b71f48 commit 54463af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common/os_calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 54463af

Please sign in to comment.