summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-06-17 15:26:49 -0400
committermidipix <writeonce@midipix.org>2016-06-17 15:26:49 -0400
commit4543c962b1488e1ccbf1fe224837e4756ddd114c (patch)
treecfa2a5c24571696065df6670cb2270b7b5261030
parent87511ee62527a04f87029f48a8365e3c2e10df42 (diff)
downloadntapi-4543c962b1488e1ccbf1fe224837e4756ddd114c.tar.bz2
ntapi-4543c962b1488e1ccbf1fe224837e4756ddd114c.tar.xz
__ntapi_sc_accept(): fix handling of ipv6 addresses.
-rw-r--r--src/socket/ntapi_sc_accept.c11
1 files changed, 11 insertions, 0 deletions
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 */