Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider that IPv6 is always enabled in Windows code #10185

Merged
merged 2 commits into from Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Changes
Expand Up @@ -62,6 +62,9 @@ Working version
directory.
(Nicolás Ojeda Bär, review by Gabriel Scherer and Xavier Leroy)

- #10185: Consider that IPv6 is always enabled on Windows.
(Antonin Décimo, review by David Allsopp and Xavier Leroy)

### Tools:

- #10139: Remove confusing navigation bar from stdlib documentation.
Expand Down
4 changes: 2 additions & 2 deletions otherlibs/unix/socket.c
Expand Up @@ -27,8 +27,8 @@ int socket_domain_table[] = {
PF_UNIX, PF_INET,
#if defined(HAS_IPV6)
PF_INET6
#elif defined(PF_UNDEF)
PF_UNDEF
#elif defined(PF_UNSPEC)
PF_UNSPEC
#else
0
#endif
Expand Down
15 changes: 1 addition & 14 deletions otherlibs/win32unix/socket.c
Expand Up @@ -17,12 +17,7 @@
#include "unixsupport.h"

int socket_domain_table[] = {
PF_UNIX, PF_INET,
#if defined(HAS_IPV6)
PF_INET6
#else
0
#endif
PF_UNIX, PF_INET, PF_INET6
};

int socket_type_table[] = {
Expand All @@ -33,14 +28,6 @@ CAMLprim value unix_socket(value cloexec, value domain, value type, value proto)
{
SOCKET s;

#ifndef HAS_IPV6
/* IPv6 requires WinSock2, we must raise an error on PF_INET6 */
if (Int_val(domain) >= sizeof(socket_domain_table)/sizeof(int)) {
win32_maperr(WSAEPFNOSUPPORT);
uerror("socket", Nothing);
}
#endif

s = socket(socket_domain_table[Int_val(domain)],
socket_type_table[Int_val(type)],
Int_val(proto));
Expand Down
2 changes: 0 additions & 2 deletions otherlibs/win32unix/unixsupport.h
Expand Up @@ -24,10 +24,8 @@
#include <process.h>
#include <sys/types.h>
#include <winsock2.h>
#ifdef HAS_IPV6
#include <ws2tcpip.h>
#include <wspiapi.h>
#endif

#ifdef __cplusplus
extern "C" {
Expand Down