public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: getifaddrs: fix address family for IPv6 netmasks
@ 2021-07-28 11:45 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2021-07-28 11:45 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c08ee10d6b9e9dc72c32387d42f3c55441657fdb

commit c08ee10d6b9e9dc72c32387d42f3c55441657fdb
Author: Ken Brown <kbrown@cornell.edu>
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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-28 11:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-28 11:45 [newlib-cygwin] Cygwin: getifaddrs: fix address family for IPv6 netmasks Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).