aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2014-04-14 08:02:06 +0200
committerDan Fandrich <dan@coneharvesters.com>2014-04-14 08:02:06 +0200
commit263ed02da6b55dfeeaaa47c3e4704074366b37c7 (patch)
treecc4044eb720b101bc9f4175bc6ee97c08ea870b0 /lib
parentb2e9c17a19196adf4b38be0927d14f805b14b95f (diff)
url: only use if_nametoindex() if IFNAMSIZ is available
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/url.c b/lib/url.c
index 73ae3ec8a..c2c90040c 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3995,7 +3995,7 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,
}
else {
/* Zone identifier is not numeric */
-#ifdef HAVE_NET_IF_H
+#if defined(HAVE_NET_IF_H) && defined(IFNAMSIZ)
char ifname[IFNAMSIZ + 2];
char *square_bracket;
unsigned int scopeidx = 0;
@@ -4019,12 +4019,9 @@ static CURLcode parseurlandfillconn(struct SessionHandle *data,
identifier_offset + strlen(ifname));
conn->scope = scopeidx;
}
- else {
-#endif /* HAVE_NET_IF_H */
+ else
+#endif /* HAVE_NET_IF_H && IFNAMSIZ */
infof(data, "Invalid IPv6 address format\n");
-#ifdef HAVE_NET_IF_H
- }
-#endif /* HAVE_NET_IF_H */
}
}
}