]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: getifaddrs: fix address family for IPv6 netmasks
authorKen Brown <kbrown@cornell.edu>
Mon, 26 Jul 2021 12:59:09 +0000 (08:59 -0400)
committerKen Brown <kbrown@cornell.edu>
Wed, 28 Jul 2021 11:37:43 +0000 (07:37 -0400)
The code in net.cc:get_ifs that sets the netmask omitted setting the
address family in the IPv6 case.  Fix this by setting it to AF_INET6.

Partially addresses: https://cygwin.com/pipermail/cygwin/2021-July/248970.html

winsup/cygwin/net.cc

index cec0a70cc825e1fc5abe117f65c32531006a69bf..67dd7fc042ca2e9e9053cc6da94dd37658f03867 100644 (file)
@@ -1869,6 +1869,7 @@ get_ifs (ULONG family)
                    if (prefix < 32)
                      if_sin6->sin6_addr.s6_addr32[cnt] <<= 32 - prefix;
                  }
+               if_sin6->sin6_family = AF_INET6;
                break;
              }
            ifp->ifa_ifa.ifa_netmask = (struct sockaddr *) &ifp->ifa_netmask;
This page took 0.032048 seconds and 5 git commands to generate.