Cygwin: getifaddrs: fix address family for IPv6 netmasks

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
This commit is contained in:
Ken Brown 2021-07-26 08:59:09 -04:00
parent 0542583129
commit c08ee10d6b
1 changed files with 1 additions and 0 deletions

View File

@ -1869,6 +1869,7 @@ get_ifs (ULONG family)
if (prefix < 32) if (prefix < 32)
if_sin6->sin6_addr.s6_addr32[cnt] <<= 32 - prefix; if_sin6->sin6_addr.s6_addr32[cnt] <<= 32 - prefix;
} }
if_sin6->sin6_family = AF_INET6;
break; break;
} }
ifp->ifa_ifa.ifa_netmask = (struct sockaddr *) &ifp->ifa_netmask; ifp->ifa_ifa.ifa_netmask = (struct sockaddr *) &ifp->ifa_netmask;