aboutsummaryrefslogtreecommitdiff
path: root/lib/connect.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-01-08 09:41:02 +0100
committerDaniel Stenberg <daniel@haxx.se>2014-01-08 09:41:38 +0100
commit2d435c7fb5b7691e8ca1f3052e1eb5bcd8a4ea27 (patch)
tree90681b4ad440d372ca2008deedd1e83296ac4efd /lib/connect.c
parent01513161830d4533cf66738c2a3cd48e88468b76 (diff)
trynextip: fix build for non-IPV6 capable systems
AF_INET6 may not exist then Patched-by: Iida Yosiaki Bug: http://curl.haxx.se/bug/view.cgi?id=1322
Diffstat (limited to 'lib/connect.c')
-rw-r--r--lib/connect.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 33f7aec3d..05666ebb6 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -556,7 +556,11 @@ static CURLcode trynextip(struct connectdata *conn,
else {
/* happy eyeballs - try the other protocol family */
int firstfamily = conn->tempaddr[0]->ai_family;
+#ifdef ENABLE_IPV6
family = (firstfamily == AF_INET) ? AF_INET6 : AF_INET;
+#else
+ family = firstfamily;
+#endif
ai = conn->tempaddr[0]->ai_next;
}