]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
connect: repair build without ipv6 availability
authorJay Satiro <raysatiro@yahoo.com>
Thu, 15 Oct 2020 06:47:49 +0000 (02:47 -0400)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 15 Oct 2020 10:56:57 +0000 (12:56 +0200)
Assisted-by: Daniel Stenberg
Reported-by: Tom G. Christensen
Fixes https://github.com/curl/curl/issues/6069
Closes https://github.com/curl/curl/pull/6071

lib/connect.c

index 5f23b79ca0b840ef610bceb9b9b810b594dfac16..7f33ea4ba859e8dc871caa3fdb39c25ea75728a6 100644 (file)
@@ -1334,8 +1334,12 @@ CURLcode Curl_connecthost(struct connectdata *conn,  /* context */
 
   conn->tempfamily[0] = conn->tempaddr[0]?
     conn->tempaddr[0]->ai_family:0;
+#ifdef ENABLE_IPV6
   conn->tempfamily[1] = conn->tempfamily[0] == AF_INET6 ?
     AF_INET : AF_INET6;
+#else
+  conn->tempfamily[1] = AF_UNSPEC;
+#endif
   ainext(conn, 1, FALSE); /* assigns conn->tempaddr[1] accordingly */
 
   DEBUGF(infof(data, "family0 == %s, family1 == %s\n",