diff options
author | midipix <writeonce@midipix.org> | 2016-04-01 15:54:55 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-04-01 15:54:55 -0400 |
commit | d02e498170e3f1c2d71e21ac8d2ce89a72fcc671 (patch) | |
tree | ff0be25425c33b0ff645c8ced3ee66a85e805136 /src | |
parent | f6c77ac338e5e7a913404658b765936782776869 (diff) | |
download | ntapi-d02e498170e3f1c2d71e21ac8d2ce89a72fcc671.tar.bz2 ntapi-d02e498170e3f1c2d71e21ac8d2ce89a72fcc671.tar.xz |
socket interfaces: ntapi_sc_connect_v2(): fix ipv6 support.
Diffstat (limited to 'src')
-rw-r--r-- | src/socket/ntapi_sc_connect_v2.c | 11 |
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; |