mirror of
https://github.com/reactos/reactos.git
synced 2024-07-13 16:15:05 +00:00
[IP]
- Fix copying of the remote address when satisfying an accept request - accept() and WSAAccept() no longer report strange peer addresses - Fixes a few ws2_32_winetest sock tests svn path=/trunk/; revision=52437
This commit is contained in:
parent
f16fa41fb2
commit
f581e4cb37
|
@ -39,24 +39,19 @@ NTSTATUS TCPServiceListeningSocket( PCONNECTION_ENDPOINT Listener,
|
|||
TI_DbgPrint(DEBUG_TCP,("Status %x\n", Status));
|
||||
|
||||
if( NT_SUCCESS(Status) && Status != STATUS_PENDING ) {
|
||||
RequestAddressReturn = WhoIsConnecting->RemoteAddress;
|
||||
RequestAddressReturn = WhoIsConnecting->RemoteAddress;
|
||||
|
||||
TI_DbgPrint(DEBUG_TCP,("Copying address to %x (Who %x)\n",
|
||||
RequestAddressReturn, WhoIsConnecting));
|
||||
TI_DbgPrint(DEBUG_TCP,("Copying address to %x (Who %x)\n",
|
||||
RequestAddressReturn, WhoIsConnecting));
|
||||
|
||||
RequestAddressReturn->TAAddressCount = 1;
|
||||
RequestAddressReturn->Address[0].AddressLength = OutAddrLen;
|
||||
RequestAddressReturn->Address[0].AddressLength = TDI_ADDRESS_LENGTH_IP;
|
||||
RequestAddressReturn->Address[0].AddressType = TDI_ADDRESS_TYPE_IP;
|
||||
RequestAddressReturn->Address[0].Address[0].sin_port = OutAddr.sin_port;
|
||||
RequestAddressReturn->Address[0].Address[0].in_addr = OutAddr.sin_addr.s_addr;
|
||||
RtlZeroMemory(RequestAddressReturn->Address[0].Address[0].sin_zero, 8);
|
||||
|
||||
/* BSD uses the first byte of the sockaddr struct as a length.
|
||||
* Since windows doesn't do that we strip it */
|
||||
RequestAddressReturn->Address[0].AddressType =
|
||||
(OutAddr.sin_family >> 8) & 0xff;
|
||||
|
||||
RtlCopyMemory( &RequestAddressReturn->Address[0].Address,
|
||||
((PCHAR)&OutAddr) + sizeof(USHORT),
|
||||
sizeof(RequestAddressReturn->Address[0].Address[0]) );
|
||||
|
||||
TI_DbgPrint(DEBUG_TCP,("Done copying\n"));
|
||||
TI_DbgPrint(DEBUG_TCP,("Done copying\n"));
|
||||
}
|
||||
|
||||
TI_DbgPrint(DEBUG_TCP,("Status %x\n", Status));
|
||||
|
|
Loading…
Reference in a new issue