From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2210) id 8E6E93835825; Wed, 28 Jul 2021 11:45:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8E6E93835825 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Ken Brown To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: getifaddrs: fix address family for IPv6 netmasks X-Act-Checkin: newlib-cygwin X-Git-Author: Ken Brown X-Git-Refname: refs/heads/master X-Git-Oldrev: 05425831290c9869bc7987b5df3ce84aa4f19a6c X-Git-Newrev: c08ee10d6b9e9dc72c32387d42f3c55441657fdb Message-Id: <20210728114533.8E6E93835825@sourceware.org> Date: Wed, 28 Jul 2021 11:45:33 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jul 2021 11:45:33 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c08ee10d6b9e9dc72c32387d42f3c55441657fdb commit c08ee10d6b9e9dc72c32387d42f3c55441657fdb Author: Ken Brown Date: Mon Jul 26 08:59:09 2021 -0400 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 Diff: --- winsup/cygwin/net.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index cec0a70cc..67dd7fc04 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -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;