From 98db18479a618106ec76130e298cf8870d2ba8aa Mon Sep 17 00:00:00 2001 From: Santiago Gimeno Date: Thu, 14 Feb 2019 11:51:33 +0100 Subject: [PATCH] src: fill sockaddr_in6.sin6_len when it's defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As some calls in some platforms require. PR-URL: https://github.com/libuv/libuv/pull/2189 Reviewed-By: Saúl Ibarra Corretgé Reviewed-By: Colin Ihrig Reviewed-By: Ben Noordhuis --- src/uv-common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/uv-common.c b/src/uv-common.c index 952bde08..e2bfdb8c 100644 --- a/src/uv-common.c +++ b/src/uv-common.c @@ -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) {