From d02e498170e3f1c2d71e21ac8d2ce89a72fcc671 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 1 Apr 2016 15:54:55 -0400 Subject: socket interfaces: ntapi_sc_connect_v2(): fix ipv6 support. --- src/socket/ntapi_sc_connect_v2.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') 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; -- cgit v1.2.3