1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

client: ipv6 handle failed ads lookup

This commit is contained in:
Andy Green 2018-07-23 17:18:47 +08:00
parent 2697be8439
commit 12ec231411

View file

@ -241,10 +241,9 @@ create_new_conn:
#ifdef LWS_WITH_IPV6
if (wsi->ipv6) {
struct sockaddr_in6 *sa6 =
((struct sockaddr_in6 *)result->ai_addr);
struct sockaddr_in6 *sa6;
if (n) {
if (n || !result) {
/* lws_getaddrinfo46 failed, there is no usable result */
lwsl_notice("%s: lws_getaddrinfo46 failed %d\n",
__func__, n);
@ -252,6 +251,8 @@ create_new_conn:
goto oom4;
}
sa6 = ((struct sockaddr_in6 *)result->ai_addr);
memset(&sa46, 0, sizeof(sa46));
sa46.sa6.sin6_family = AF_INET6;