[PATCH] ws2_32: Allow user to enable IP dual stack.

Bruno Jesus 00cpxxx at gmail.com
Fri Jul 1 10:44:39 CDT 2016


On Thu, Jun 30, 2016 at 5:57 AM, Matthieu Nottale
<matthieu.nottale at infinit.io> wrote:
>
> IP dual stack (v4+v6) should be disabled by default, but previous code
> was setting IPV6_V6ONLY in bind() which prevented user to override it.
> This patch moves setting IPV6_V6ONLY to socket creation time.

Hi, can you explain more about what is the problem? Is there any
application affected?

> @@ -7163,6 +7149,14 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
>          TRACE("\tcreated %04lx\n", ret );
>          if (ipxptype > 0)
>              set_ipx_packettype(ret, ipxptype);
> +#ifdef IPV6_V6ONLY
> +        if (af == WS_AF_INET6)
> +        {
> +          // dual stack (v4+v6) should be disabled by default
> +          int enable = 1;
> +          WS_setsockopt(ret, WS_IPPROTO_IPV6, WS_IPV6_V6ONLY, &enable, sizeof(enable));
> +        }
> +#endif
>         return ret;
>      }

// comments are not allowed, use /* */. Please use unixaf == AF_INET6
as the code uses that as the af var was already parsed by this point
in the code.

And please write tests to prove this behavior, create the AF_INET6
socket and getsockopt(IPV6_V6ONLY) in order to determine the default
on Windows and then bind and read again to prove it does not change
automagically (like Wine is doind). Since in Wine the operation is
only done when binding to anyaddr it should be useful to also try a
specific address bind and check too.

Best wishes,
Bruno



More information about the wine-devel mailing list