mirror of
https://github.com/reactos/reactos.git
synced 2024-09-13 06:11:59 +00:00
[IP]
- fix system crash when failing to connect to a remote host - Set address length in the TDI address struct - Simplify copying the address - Zero the sin_zero member svn path=/branches/GSoC_2011/TcpIpDriver/; revision=52485
This commit is contained in:
parent
3f6a8fa6c2
commit
9aa2d2c133
|
@ -135,16 +135,15 @@ VOID DGDeliverData(
|
|||
RTAIPAddress = (PTA_IP_ADDRESS)Current->ReturnInfo->RemoteAddress;
|
||||
RTAIPAddress->TAAddressCount = 1;
|
||||
RTAIPAddress->Address->AddressType = TDI_ADDRESS_TYPE_IP;
|
||||
RTAIPAddress->Address->AddressLength = TDI_ADDRESS_LENGTH_IP;
|
||||
RTAIPAddress->Address->Address->sin_port = SrcPort;
|
||||
RTAIPAddress->Address->Address->in_addr = SrcAddress->Address.IPv4Address;
|
||||
RtlZeroMemory(RTAIPAddress->Address->Address->sin_zero, 8);
|
||||
|
||||
TI_DbgPrint(MAX_TRACE, ("(A: %08x) Addr %08x Port %04x\n",
|
||||
RTAIPAddress,
|
||||
SrcAddress->Address.IPv4Address, SrcPort));
|
||||
|
||||
RtlCopyMemory( &RTAIPAddress->Address->Address->in_addr,
|
||||
&SrcAddress->Address.IPv4Address,
|
||||
sizeof(SrcAddress->Address.IPv4Address) );
|
||||
|
||||
ReferenceObject(AddrFile);
|
||||
UnlockObject(AddrFile, OldIrql);
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ FlushAllQueues(PCONNECTION_ENDPOINT Connection, NTSTATUS Status)
|
|||
|
||||
ReferenceObject(Connection);
|
||||
|
||||
DbgPrint("[IP, FlushAllQueues] Flushing recv/all with status: 0x%x\n", Status);
|
||||
DbgPrint("[IP, FlushAllQueues] Flushing recv/all with status: 0x%x fox Connection = 0x%x\n", Status, Connection);
|
||||
|
||||
while ((Entry = ExInterlockedRemoveHeadList(&Connection->ReceiveRequest, &Connection->Lock)))
|
||||
{
|
||||
|
@ -103,7 +103,7 @@ FlushAllQueues(PCONNECTION_ENDPOINT Connection, NTSTATUS Status)
|
|||
Bucket->Status = Status;
|
||||
Bucket->Information = 0;
|
||||
|
||||
DbgPrint("[IP, FlushAllQueues] Flushing Listen request for Connection = 0x%x\n", Bucket->AssociatedEndpoint);
|
||||
DbgPrint("[IP, FlushAllQueues] Completing Listen request for Connection = 0x%x\n", Bucket->AssociatedEndpoint);
|
||||
|
||||
DereferenceObject(Bucket->AssociatedEndpoint);
|
||||
CompleteBucket(Connection, Bucket, TRUE);
|
||||
|
@ -129,22 +129,28 @@ FlushAllQueues(PCONNECTION_ENDPOINT Connection, NTSTATUS Status)
|
|||
|
||||
Bucket->Status = Status;
|
||||
Bucket->Information = 0;
|
||||
|
||||
DbgPrint("[IP, FlushAllQueues] Completing Connection request for Connection = 0x%x\n", Bucket->AssociatedEndpoint);
|
||||
|
||||
CompleteBucket(Connection, Bucket, TRUE);
|
||||
}
|
||||
|
||||
DereferenceObject(Connection);
|
||||
|
||||
DbgPrint("[IP, FlushAllQueues] Leaving\n");
|
||||
}
|
||||
|
||||
VOID
|
||||
TCPFinEventHandler(void *arg, err_t err)
|
||||
{
|
||||
PCONNECTION_ENDPOINT Connection = arg;
|
||||
|
||||
FlushAllQueues(Connection, TCPTranslateError(err));
|
||||
|
||||
|
||||
/* We're already closed so we don't want to call lwip_close */
|
||||
Connection->SocketContext = NULL;
|
||||
|
||||
DbgPrint("[IP, TCPFinEventHandler] Called for Connection( 0x%x )-> SocketContext = pcb (0x%x)\n", Connection, Connection->SocketContext);
|
||||
|
||||
FlushAllQueues(Connection, TCPTranslateError(err));
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
Loading…
Reference in a new issue