Merge pull request #4207 from GregorR/natt-ipv6-without-ipv6

NAT traversal also needs to avoid IPv6 with SOCKET_LEGACY
This commit is contained in:
Twinaphex 2016-12-10 20:01:32 +01:00 committed by GitHub
commit 65dcf03e30
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ struct natt_status {
/** True if we've resolved an external IPv6 address */
bool have_inet6;
#ifdef AF_INET6
#if defined(AF_INET6) && !defined(HAVE_SOCKET_LEGACY)
/** External IPv6 address */
struct sockaddr_in6 ext_inet6_addr;
#endif

View File

@ -141,7 +141,7 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t
status->have_inet4 = true;
status->ext_inet4_addr = *((struct sockaddr_in *) ext_addrinfo->ai_addr);
}
#ifdef AF_INET6
#if defined(AF_INET6) && !defined(HAVE_SOCKET_LEGACY)
else if (ext_addrinfo->ai_family == AF_INET6 &&
ext_addrinfo->ai_addrlen >= sizeof(struct sockaddr_in6))
{