src: fill sockaddr_in6.sin6_len when it's defined

As some calls in some platforms require.

PR-URL: https://github.com/libuv/libuv/pull/2189
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Santiago Gimeno 2019-02-14 11:51:33 +01:00
parent 19d8eb0c92
commit 98db18479a
No known key found for this signature in database
GPG Key ID: F28C3C8DA33C03BE

View File

@ -222,6 +222,9 @@ int uv_ip6_addr(const char* ip, int port, struct sockaddr_in6* addr) {
memset(addr, 0, sizeof(*addr));
addr->sin6_family = AF_INET6;
addr->sin6_port = htons(port);
#ifdef SIN6_LEN
addr->sin6_len = sizeof(*addr);
#endif
zone_index = strchr(ip, '%');
if (zone_index != NULL) {