diff options
author | Brad King <brad.king@kitware.com> | 2016-08-03 18:26:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-03 18:26:53 (GMT) |
commit | f53f4a8a2d215dac634effea575a27e000dfcb29 (patch) | |
tree | 5782e71da9e12ab6081e47f8eaf8eeb908e1428a /Utilities/cmcurl/lib/if2ip.c | |
parent | e1c11352f231ae310339cd539ed59cb302bd4dbe (diff) | |
parent | 202adcfe056681109fe61569ecdb3bd69f0b4f97 (diff) | |
download | CMake-f53f4a8a2d215dac634effea575a27e000dfcb29.zip CMake-f53f4a8a2d215dac634effea575a27e000dfcb29.tar.gz CMake-f53f4a8a2d215dac634effea575a27e000dfcb29.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2016-08-03 (f2cb3a01)
Diffstat (limited to 'Utilities/cmcurl/lib/if2ip.c')
-rw-r--r-- | Utilities/cmcurl/lib/if2ip.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Utilities/cmcurl/lib/if2ip.c b/Utilities/cmcurl/lib/if2ip.c index 6e6f969..2f92b2d 100644 --- a/Utilities/cmcurl/lib/if2ip.c +++ b/Utilities/cmcurl/lib/if2ip.c @@ -5,11 +5,11 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2016, 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 - * are also available at http://curl.haxx.se/docs/copyright.html. + * are also available at https://curl.haxx.se/docs/copyright.html. * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is @@ -53,10 +53,9 @@ #include "inet_ntop.h" #include "strequal.h" #include "if2ip.h" +/* The last 3 #include files should be in this order */ #include "curl_printf.h" - #include "curl_memory.h" -/* The last #include file should be: */ #include "memdebug.h" /* ------------------------------------------------------------------ */ @@ -68,7 +67,7 @@ unsigned int Curl_ipv6_scope(const struct sockaddr *sa) (void) sa; #else if(sa->sa_family == AF_INET6) { - const struct sockaddr_in6 * sa6 = (const struct sockaddr_in6 *) sa; + const struct sockaddr_in6 * sa6 = (const struct sockaddr_in6 *)(void *) sa; const unsigned char * b = sa6->sin6_addr.s6_addr; unsigned short w = (unsigned short) ((b[0] << 8) | b[1]); @@ -152,11 +151,12 @@ if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope, continue; } - addr = &((struct sockaddr_in6 *)iface->ifa_addr)->sin6_addr; + addr = + &((struct sockaddr_in6 *)(void *)iface->ifa_addr)->sin6_addr; #ifdef HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID /* Include the scope of this interface as part of the address */ - scopeid = - ((struct sockaddr_in6 *)iface->ifa_addr)->sin6_scope_id; + scopeid = ((struct sockaddr_in6 *)(void *)iface->ifa_addr) + ->sin6_scope_id; /* If given, scope id should match. */ if(remote_scope_id && scopeid != remote_scope_id) { @@ -171,7 +171,8 @@ if2ip_result_t Curl_if2ip(int af, unsigned int remote_scope, } else #endif - addr = &((struct sockaddr_in *)iface->ifa_addr)->sin_addr; + addr = + &((struct sockaddr_in *)(void *)iface->ifa_addr)->sin_addr; res = IF2IP_FOUND; ip = (char *) Curl_inet_ntop(af, addr, ipstr, sizeof(ipstr)); snprintf(buf, buf_size, "%s%s", ip, scope); |