url: only use if_nametoindex() if IFNAMSIZ is available
authorDan Fandrich <dan@coneharvesters.com>
Mon, 14 Apr 2014 06:02:06 +0000 (08:02 +0200)
committerDan Fandrich <dan@coneharvesters.com>
Mon, 14 Apr 2014 06:02:06 +0000 (08:02 +0200)
lib/url.c

index 73ae3ec8ae06552756c2a96a3f1db91b634c30c5..c2c90040c3e29ce3f6a6f5d077b4cbedf834ddcb 100644 (file)
--- 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 */
       }
     }
   }