[ros-diffs] [cgutman] 37032: - Merge r37029 from aicom-network-fixes - This fixes the last of all the port allocation bugs that I know of

cgutman at svn.reactos.org cgutman at svn.reactos.org
Mon Oct 27 21:43:44 CET 2008


Author: cgutman
Date: Mon Oct 27 15:43:44 2008
New Revision: 37032

URL: http://svn.reactos.org/svn/reactos?rev=37032&view=rev
Log:
 - Merge r37029 from aicom-network-fixes
 - This fixes the last of all the port allocation bugs that I know of

Modified:
    trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c

Modified: trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c?rev=37032&r1=37031&r2=37032&view=diff
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] Mon Oct 27 15:43:44 2008
@@ -286,8 +286,9 @@
       AddrFile->Port =
           TCPAllocatePort(Address->Address[0].Address[0].sin_port);
 
-      if (Address->Address[0].Address[0].sin_port &&
-          AddrFile->Port != Address->Address[0].Address[0].sin_port)
+      if ((Address->Address[0].Address[0].sin_port &&
+           AddrFile->Port != Address->Address[0].Address[0].sin_port) ||
+           AddrFile->Port == 0xffff)
       {
           ExFreePool(AddrFile);
           return STATUS_INVALID_PARAMETER;
@@ -301,8 +302,9 @@
       AddrFile->Port =
 	  UDPAllocatePort(Address->Address[0].Address[0].sin_port);
 
-      if (Address->Address[0].Address[0].sin_port &&
-          AddrFile->Port != Address->Address[0].Address[0].sin_port)
+      if ((Address->Address[0].Address[0].sin_port &&
+           AddrFile->Port != Address->Address[0].Address[0].sin_port) ||
+           AddrFile->Port == 0xffff)
       {
           ExFreePool(AddrFile);
           return STATUS_INVALID_PARAMETER;



More information about the Ros-diffs mailing list