Author: cgutman
Date: Sat Oct 25 17:44:56 2008
New Revision: 36970
URL:
http://svn.reactos.org/svn/reactos?rev=36970&view=rev
Log:
- Check the status of OskitTCPBind
Modified:
branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c
branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c
Modified: branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/accept.c [iso-8859-1] Sat
Oct 25 17:44:56 2008
@@ -87,13 +87,13 @@
TI_DbgPrint(DEBUG_TCP,("AddressToBind - %x:%x\n", AddressToBind.sin_addr,
AddressToBind.sin_port));
- OskitTCPBind( Connection->SocketContext,
- Connection,
- &AddressToBind,
- sizeof(AddressToBind) );
+ Status = TCPTranslateError( OskitTCPBind( Connection->SocketContext,
+ Connection,
+ &AddressToBind,
+ sizeof(AddressToBind) ) );
- Status = TCPTranslateError( OskitTCPListen( Connection->SocketContext,
- Backlog ) );
+ if (NT_SUCCESS(Status))
+ Status = TCPTranslateError( OskitTCPListen( Connection->SocketContext, Backlog
) );
TcpipRecursiveMutexLeave( &TCPLock );
Modified: branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c
URL:
http://svn.reactos.org/svn/reactos/branches/aicom-network-fixes/lib/drivers…
==============================================================================
--- branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1]
(original)
+++ branches/aicom-network-fixes/lib/drivers/ip/transport/tcp/tcp.c [iso-8859-1] Sat Oct
25 17:44:56 2008
@@ -577,21 +577,24 @@
AddressToConnect.sin_family = AF_INET;
AddressToBind = AddressToConnect;
- OskitTCPBind( Connection->SocketContext,
+ Status = TCPTranslateError
+ ( OskitTCPBind( Connection->SocketContext,
Connection,
&AddressToBind,
- sizeof(AddressToBind) );
-
- memcpy( &AddressToConnect.sin_addr,
- &RemoteAddress.Address.IPv4Address,
- sizeof(AddressToConnect.sin_addr) );
- AddressToConnect.sin_port = RemotePort;
-
- Status = TCPTranslateError
- ( OskitTCPConnect( Connection->SocketContext,
- Connection,
- &AddressToConnect,
- sizeof(AddressToConnect) ) );
+ sizeof(AddressToBind) ) );
+
+ if (NT_SUCCESS(Status)) {
+ memcpy( &AddressToConnect.sin_addr,
+ &RemoteAddress.Address.IPv4Address,
+ sizeof(AddressToConnect.sin_addr) );
+ AddressToConnect.sin_port = RemotePort;
+
+ Status = TCPTranslateError
+ ( OskitTCPConnect( Connection->SocketContext,
+ Connection,
+ &AddressToConnect,
+ sizeof(AddressToConnect) ) );
+ }
TcpipRecursiveMutexLeave( &TCPLock );