From: simon Date: Wed, 17 Oct 2012 20:48:07 +0000 (+0000) Subject: Windows's sk_address_is_local() was returning the wrong answers for X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/commitdiff_plain/0eece8a7f0c4e65b2f51572c8c792bed1b5a48d2 Windows's sk_address_is_local() was returning the wrong answers for IPv6 addresses, because I'd mistakenly cast an ai_addr to the low- level 'struct in6_addr' instead of the correct 'struct sockaddr_in6'. git-svn-id: svn://svn.tartarus.org/sgt/putty@9690 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/windows/winnet.c b/windows/winnet.c index 2088f9d7..c82959ac 100644 --- a/windows/winnet.c +++ b/windows/winnet.c @@ -645,7 +645,7 @@ int sk_address_is_local(SockAddr addr) #ifndef NO_IPV6 if (family == AF_INET6) { - return IN6_IS_ADDR_LOOPBACK((const struct in6_addr *)step.ai->ai_addr); + return IN6_IS_ADDR_LOOPBACK(&((const struct sockaddr_in6 *)step.ai->ai_addr)->sin6_addr); } else #endif if (family == AF_INET) {