From 31e02ce543cf88a8e86731d8bc07c8aa0ce21eb8 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 27 Oct 2008 20:43:44 +0000 Subject: [PATCH] - Merge r37029 from aicom-network-fixes - This fixes the last of all the port allocation bugs that I know of svn path=/trunk/; revision=37032 --- reactos/drivers/network/tcpip/tcpip/fileobjs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/reactos/drivers/network/tcpip/tcpip/fileobjs.c b/reactos/drivers/network/tcpip/tcpip/fileobjs.c index 915ea4acf03..da337e8d951 100644 --- a/reactos/drivers/network/tcpip/tcpip/fileobjs.c +++ b/reactos/drivers/network/tcpip/tcpip/fileobjs.c @@ -286,8 +286,9 @@ NTSTATUS FileOpenAddress( 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 @@ NTSTATUS FileOpenAddress( 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;