From 4543c962b1488e1ccbf1fe224837e4756ddd114c Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 17 Jun 2016 15:26:49 -0400 Subject: __ntapi_sc_accept(): fix handling of ipv6 addresses. --- src/socket/ntapi_sc_accept.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/socket') diff --git a/src/socket/ntapi_sc_accept.c b/src/socket/ntapi_sc_accept.c index 3390616..bda6a83 100644 --- a/src/socket/ntapi_sc_accept.c +++ b/src/socket/ntapi_sc_accept.c @@ -14,6 +14,8 @@ typedef struct __addr_memcpy { uint64_t d0; uint64_t d1; + uint64_t d2; + uint32_t d3; } _addr_memcpy; @@ -72,6 +74,15 @@ int32_t __cdecl __ntapi_sc_accept( dst->d0 = src->d0; dst->d1 = src->d1; + + if ((size_t)iosb->info >= sizeof(accept_info.sequence) + + sizeof(nt_sockaddr_in6)) { + dst->d2 = src->d2; + dst->d3 = src->d3; + } else { + dst->d2 = 0; + dst->d3 = 0; + } } /* return address length information */ -- cgit v1.2.3