Author: cgutman
Date: Sun Jul 3 02:13:57 2011
New Revision: 52511
URL:
http://svn.reactos.org/svn/reactos?rev=52511&view=rev
Log:
[TCPIP]
- Only wait to bind to a port if INADDR_ANY is specified
- Fixes EADDRNOTAVAIL when running Firefox and ws2_32_winetest sock (which now gets
further but still doesn't complete)
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/tcpi…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/tcpip/fileobjs.c [iso-8859-1] Sun Jul 3 02:13:57
2011
@@ -295,9 +295,21 @@
/* Sanity check */
ASSERT(Address->Address[0].Address[0].sin_port == AddrFile->Port);
}
+ else if (!AddrIsUnspecified(&AddrFile->Address))
+ {
+ /* The client is trying to bind to a local address so allocate a port now too
*/
+ AddrFile->Port = TCPAllocatePort(0);
+
+ /* Check for bind success */
+ if (AddrFile->Port == 0xffff)
+ {
+ ExFreePoolWithTag(AddrFile, ADDR_FILE_TAG);
+ return STATUS_ADDRESS_ALREADY_EXISTS;
+ }
+ }
else
{
- /* The client wants an unspecified port so we wait to see what the TCP library
gives us */
+ /* The client wants an unspecified port with an unspecified address so we wait
to see what the TCP library gives us */
AddrFile->Port = 0;
}