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

Dmitry Timoshkov dmitry at baikal.ru
Tue Oct 18 06:30:53 CDT 2016


Roman Pišl <rpisl at seznam.cz> 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.
> 
> V5 - fixes failing test on Windows
> 
> Based on https://www.winehq.org/pipermail/wine-patches/2016-July/151919.html
> 
> Signed-off-by: Matthieu Nottale <matthieu.nottale at infinit.io>
> Signed-off-by: Roman Pišl <rpisl at seznam.cz>

Probably you shouldn't add someone's else sign-off without the author's
agreement, or mention that you've got an explicit agreement from the patch
author otherwise.

> +#ifdef IPV6_V6ONLY
> +        if (unixaf == AF_INET6)
> +        {
> +            int enable = 1;
> +            int fd = get_sock_fd(ret, 0, NULL);
> +            setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &enable, sizeof(enable));
> +        }
> +#endif

It's better to verify that get_sock_fd() succeded before using its result,
and call release_sock_fd() at the end.

-- 
Dmitry.



More information about the wine-devel mailing list