From 034ea318af8a5018c30271874a048fb07a2fa48f Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Sat, 26 Jan 2013 04:16:26 +0100 Subject: [PATCH] win: get rid of early ipv6 support detection No longer explictly check wheter an IPv6 stack is present when the user tries to use IPV6 sockets. Instead realy on the operating system to report the lack of protocol support via appropriate error messages. --- src/win/internal.h | 3 --- src/win/tcp.c | 5 ----- src/win/winsock.c | 5 ----- 3 files changed, 13 deletions(-) diff --git a/src/win/internal.h b/src/win/internal.h index b9f8bba7..9dc58d5d 100644 --- a/src/win/internal.h +++ b/src/win/internal.h @@ -323,9 +323,6 @@ int WSAAPI uv_wsarecvfrom_workaround(SOCKET socket, WSABUF* buffers, int WSAAPI uv_msafd_poll(SOCKET socket, AFD_POLL_INFO* info, OVERLAPPED* overlapped); -/* Whether ipv6 is supported */ -extern int uv_allow_ipv6; - /* Whether there are any non-IFS LSPs stacked on TCP */ extern int uv_tcp_non_ifs_lsp_ipv4; extern int uv_tcp_non_ifs_lsp_ipv6; diff --git a/src/win/tcp.c b/src/win/tcp.c index 7fd4a6af..8e95c384 100644 --- a/src/win/tcp.c +++ b/src/win/tcp.c @@ -769,11 +769,6 @@ int uv__tcp_connect6(uv_connect_t* req, BOOL success; DWORD bytes; - if (!uv_allow_ipv6) { - uv__set_sys_error(loop, WSAEAFNOSUPPORT); - return -1; - } - if (handle->flags & UV_HANDLE_BIND_ERROR) { uv__set_sys_error(loop, handle->bind_error); return -1; diff --git a/src/win/winsock.c b/src/win/winsock.c index cbd25af0..47395bb8 100644 --- a/src/win/winsock.c +++ b/src/win/winsock.c @@ -25,9 +25,6 @@ #include "internal.h" -/* Whether ipv6 is supported */ -int uv_allow_ipv6; - /* Whether there are any non-IFS LSPs stacked on TCP */ int uv_tcp_non_ifs_lsp_ipv4; int uv_tcp_non_ifs_lsp_ipv6; @@ -131,8 +128,6 @@ void uv_winsock_init() { dummy = socket(AF_INET6, SOCK_STREAM, IPPROTO_IP); if (dummy != INVALID_SOCKET) { - uv_allow_ipv6 = TRUE; - opt_len = (int) sizeof protocol_info; if (!getsockopt(dummy, SOL_SOCKET,