Windows's sk_address_is_local() was returning the wrong answers for
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 17 Oct 2012 20:48:07 +0000 (20:48 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Wed, 17 Oct 2012 20:48:07 +0000 (20:48 +0000)
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

windows/winnet.c

index 2088f9d..c82959a 100644 (file)
@@ -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) {