Skip to content

Commit 5d980ec

Browse files
Berrysoftgithub-cygwin
authored andcommitted
Cygwin: fhandler_local: Fix get_inet_addr_local to retrieve correct type
For a datagram socket received by recvfrom, the type param is not assigned correctly, making fhandler_socket_local::connect() to return WSAEPROTOTYPE. Fixes: 2617a91 ("* fhandler_socket.cc (get_inet_addr): Handle abstract AF_LOCAL socket.") Signed-off-by: Yuyi Wang <[email protected]> (cherry picked from commit 3b06366)
1 parent 48e7d63 commit 5d980ec

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

winsup/cygwin/fhandler/socket_local.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ get_inet_addr_local (const struct sockaddr *in, int inlen,
8787
addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
8888
*outlen = sizeof addr;
8989
memcpy (out, &addr, *outlen);
90+
if (type)
91+
*type = SOCK_DGRAM;
9092
return 0;
9193
}
9294

winsup/cygwin/release/3.6.2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ Fixes:
44
- Fix a high latency problem when trying to fetch SID info for SIDs
55
not resolved by Windows functions anyway.
66
Addresses: https://cygwin.com/pipermail/cygwin/2025-April/257916.html
7+
8+
- Fix connect(2) returning WSAEPROTOTYPE on abstract sockets.
9+
Addresses: https://sourceware.org/pipermail/cygwin-patches/2025q2/013638.html

0 commit comments

Comments
 (0)