- Send DHCP discover after loading the configuration so we have valid options
authorCameron Gutman <aicommander@gmail.com>
Thu, 22 Oct 2009 00:55:45 +0000 (00:55 +0000)
committerCameron Gutman <aicommander@gmail.com>
Thu, 22 Oct 2009 00:55:45 +0000 (00:55 +0000)
 - Fixes erratic behavior with certain DHCP servers

svn path=/trunk/; revision=43678

reactos/base/services/dhcp/adapter.c

index 18d52d2..ea848bc 100644 (file)
@@ -199,9 +199,7 @@ BOOL PrepareAdapterForService( PDHCP_ADAPTER Adapter ) {
                         Adapter->DhclientInfo.name,
                         Adapter->BindStatus));
 
-        add_protocol(Adapter->DhclientInfo.name, Adapter->DhclientInfo.rfdesc, got_one, &Adapter->DhclientInfo);
        Adapter->DhclientInfo.client->state = S_INIT;
-       state_reboot(&Adapter->DhclientInfo);
     }
 
     if( IPAddress ) free( IPAddress );
@@ -331,6 +329,15 @@ BOOLEAN AdapterDiscover() {
 
                 read_client_conf(&Adapter->DhclientInfo);
 
+                if (Adapter->DhclientInfo.client->state == S_INIT)
+                {
+                    add_protocol(Adapter->DhclientInfo.name,
+                                 Adapter->DhclientInfo.rfdesc,
+                                 got_one, &Adapter->DhclientInfo);
+
+                   state_init(&Adapter->DhclientInfo);
+                }
+
                 InsertTailList( &AdapterList, &Adapter->ListEntry );
             } else { free( Adapter ); Adapter = 0; }
         } else { free( Adapter ); Adapter = 0; }