summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-01 15:54:55 -0400
committermidipix <writeonce@midipix.org>2016-04-01 15:54:55 -0400
commitd02e498170e3f1c2d71e21ac8d2ce89a72fcc671 (patch)
treeff0be25425c33b0ff645c8ced3ee66a85e805136
parentf6c77ac338e5e7a913404658b765936782776869 (diff)
downloadntapi-d02e498170e3f1c2d71e21ac8d2ce89a72fcc671.tar.bz2
ntapi-d02e498170e3f1c2d71e21ac8d2ce89a72fcc671.tar.xz
socket interfaces: ntapi_sc_connect_v2(): fix ipv6 support.
-rw-r--r--src/socket/ntapi_sc_connect_v2.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/socket/ntapi_sc_connect_v2.c b/src/socket/ntapi_sc_connect_v2.c
index 919ee10..5d839f2 100644
--- a/src/socket/ntapi_sc_connect_v2.c
+++ b/src/socket/ntapi_sc_connect_v2.c
@@ -20,6 +20,8 @@ typedef struct _nt_afd_connect_request {
typedef struct __addr_memcpy {
uint64_t d0;
uint64_t d1;
+ uint64_t d2;
+ uint32_t d3;
} _addr_memcpy;
@@ -36,6 +38,10 @@ int32_t __cdecl __ntapi_sc_connect_v2(
_addr_memcpy * src;
_addr_memcpy * dst;
+ if ((addrlen != sizeof(nt_sockaddr_in4))
+ && (addrlen != sizeof(nt_sockaddr_in6)))
+ return NT_STATUS_INVALID_PARAMETER_3;
+
iosb = iosb ? iosb : &siosb;
/* afd_connect_req */
@@ -48,6 +54,11 @@ int32_t __cdecl __ntapi_sc_connect_v2(
dst->d0 = src->d0;
dst->d1 = src->d1;
+ if (addrlen == sizeof(nt_sockaddr_in6)) {
+ dst->d2 = src->d2;
+ dst->d3 = src->d3;
+ }
+
afd_connect_req.paddr = &(afd_connect_req.addr);
afd_connect_req.addr.sa_addr_in4.sa_family = hssocket->domain;