Author: cgutman
Date: Thu Jul 22 19:37:33 2010
New Revision: 48195
URL:
http://svn.reactos.org/svn/reactos?rev=48195&view=rev
Log:
[DHCPCSVC]
- Add a hack so we wait for TCP/IP to get ready and bind to adapters instead of failing
immediately after the first probe
- Live CD and 2nd stage setup now have fully functional networking :)
Modified:
trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c
Modified: trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/dhcpcsvc/dhcp/ad…
==============================================================================
--- trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/dhcpcsvc/dhcp/adapter.c [iso-8859-1] Thu Jul 22 19:37:33 2010
@@ -233,7 +233,7 @@
PDHCP_ADAPTER Adapter = NULL;
HANDLE AdapterStateChangedEvent = (HANDLE)Context;
struct interface_info *ifi = NULL;
- int i;
+ int i, AdapterCount = 0;
/* FIXME: Kill this thread when the service is stopped */
@@ -248,7 +248,11 @@
}
if( Error != NO_ERROR )
- break;
+ {
+ /* HACK: We are waiting until TCP/IP starts */
+ Sleep(2000);
+ continue;
+ }
DH_DbgPrint(MID_TRACE,("Got Adapter List (%d entries)\n",
Table->dwNumEntries));
@@ -347,6 +351,7 @@
ApiLock();
InsertTailList( &AdapterList, &Adapter->ListEntry );
DbgPrint("DHCPCSVC: Discovered new adapter [%s]\n",
Adapter->DhclientInfo.name);
+ AdapterCount++;
SetEvent(AdapterStateChangedEvent);
ApiUnlock();
} else { free( Adapter ); Adapter = 0; }
@@ -356,7 +361,17 @@
DH_DbgPrint(MID_TRACE,("Adapter %d was rejected\n",
Table->table[i].dwIndex));
}
- } while ((Error = NotifyAddrChange(NULL, NULL)) == NO_ERROR);
+ Error = NotifyAddrChange(NULL, NULL);
+#if 0
+ if (Error != NO_ERROR)
+ break;
+#else
+ if (AdapterCount)
+ break;
+ else
+ Sleep(3000);
+#endif
+ } while (TRUE);
DbgPrint("DHCPCSVC: Adapter discovery thread is terminating! (Error:
%d)\n", Error);