mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 16:25:43 +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
2 changed files with 14 additions and 9 deletions
|
@ -135,16 +135,15 @@ VOID DGDeliverData(
|
||||||
RTAIPAddress = (PTA_IP_ADDRESS)Current->ReturnInfo->RemoteAddress;
|
RTAIPAddress = (PTA_IP_ADDRESS)Current->ReturnInfo->RemoteAddress;
|
||||||
RTAIPAddress->TAAddressCount = 1;
|
RTAIPAddress->TAAddressCount = 1;
|
||||||
RTAIPAddress->Address->AddressType = TDI_ADDRESS_TYPE_IP;
|
RTAIPAddress->Address->AddressType = TDI_ADDRESS_TYPE_IP;
|
||||||
|
RTAIPAddress->Address->AddressLength = TDI_ADDRESS_LENGTH_IP;
|
||||||
RTAIPAddress->Address->Address->sin_port = SrcPort;
|
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",
|
TI_DbgPrint(MAX_TRACE, ("(A: %08x) Addr %08x Port %04x\n",
|
||||||
RTAIPAddress,
|
RTAIPAddress,
|
||||||
SrcAddress->Address.IPv4Address, SrcPort));
|
SrcAddress->Address.IPv4Address, SrcPort));
|
||||||
|
|
||||||
RtlCopyMemory( &RTAIPAddress->Address->Address->in_addr,
|
|
||||||
&SrcAddress->Address.IPv4Address,
|
|
||||||
sizeof(SrcAddress->Address.IPv4Address) );
|
|
||||||
|
|
||||||
ReferenceObject(AddrFile);
|
ReferenceObject(AddrFile);
|
||||||
UnlockObject(AddrFile, OldIrql);
|
UnlockObject(AddrFile, OldIrql);
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ FlushAllQueues(PCONNECTION_ENDPOINT Connection, NTSTATUS Status)
|
||||||
|
|
||||||
ReferenceObject(Connection);
|
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)))
|
while ((Entry = ExInterlockedRemoveHeadList(&Connection->ReceiveRequest, &Connection->Lock)))
|
||||||
{
|
{
|
||||||
|
@ -103,7 +103,7 @@ FlushAllQueues(PCONNECTION_ENDPOINT Connection, NTSTATUS Status)
|
||||||
Bucket->Status = Status;
|
Bucket->Status = Status;
|
||||||
Bucket->Information = 0;
|
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);
|
DereferenceObject(Bucket->AssociatedEndpoint);
|
||||||
CompleteBucket(Connection, Bucket, TRUE);
|
CompleteBucket(Connection, Bucket, TRUE);
|
||||||
|
@ -130,10 +130,14 @@ FlushAllQueues(PCONNECTION_ENDPOINT Connection, NTSTATUS Status)
|
||||||
Bucket->Status = Status;
|
Bucket->Status = Status;
|
||||||
Bucket->Information = 0;
|
Bucket->Information = 0;
|
||||||
|
|
||||||
|
DbgPrint("[IP, FlushAllQueues] Completing Connection request for Connection = 0x%x\n", Bucket->AssociatedEndpoint);
|
||||||
|
|
||||||
CompleteBucket(Connection, Bucket, TRUE);
|
CompleteBucket(Connection, Bucket, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
DereferenceObject(Connection);
|
DereferenceObject(Connection);
|
||||||
|
|
||||||
|
DbgPrint("[IP, FlushAllQueues] Leaving\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
@ -141,10 +145,12 @@ TCPFinEventHandler(void *arg, err_t err)
|
||||||
{
|
{
|
||||||
PCONNECTION_ENDPOINT Connection = arg;
|
PCONNECTION_ENDPOINT Connection = arg;
|
||||||
|
|
||||||
FlushAllQueues(Connection, TCPTranslateError(err));
|
|
||||||
|
|
||||||
/* We're already closed so we don't want to call lwip_close */
|
/* We're already closed so we don't want to call lwip_close */
|
||||||
Connection->SocketContext = NULL;
|
Connection->SocketContext = NULL;
|
||||||
|
|
||||||
|
DbgPrint("[IP, TCPFinEventHandler] Called for Connection( 0x%x )-> SocketContext = pcb (0x%x)\n", Connection, Connection->SocketContext);
|
||||||
|
|
||||||
|
FlushAllQueues(Connection, TCPTranslateError(err));
|
||||||
}
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue