From 6975847e62b996e0d125f54e5a3132b88de928f1 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Wed, 13 Nov 2019 09:15:36 +0000 Subject: [PATCH] lws_getaddrinfov46: make sure to set ai_socktype for ipv6 --- lib/roles/http/client/client-handshake.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/roles/http/client/client-handshake.c b/lib/roles/http/client/client-handshake.c index 278a66f21..b6b864c52 100644 --- a/lib/roles/http/client/client-handshake.c +++ b/lib/roles/http/client/client-handshake.c @@ -33,6 +33,8 @@ lws_getaddrinfo46(struct lws *wsi, const char *ads, struct addrinfo **result) memset(&hints, 0, sizeof(hints)); *result = NULL; + hints.ai_socktype = SOCK_STREAM; + #ifdef LWS_WITH_IPV6 if (wsi->ipv6) { @@ -44,7 +46,6 @@ lws_getaddrinfo46(struct lws *wsi, const char *ads, struct addrinfo **result) #endif { hints.ai_family = PF_UNSPEC; - hints.ai_socktype = SOCK_STREAM; } return getaddrinfo(ads, NULL, &hints, result);