Skip to content

Commit

Permalink
src: fill sockaddr_in6.sin6_len when it's defined
Browse files Browse the repository at this point in the history
As some calls in some platforms require.

PR-URL: libuv#2189
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
santigimeno authored and njlr committed Apr 5, 2019
1 parent ea42729 commit 25f864d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/uv-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 25f864d

Please sign in to comment.