[DHCPCSVC]
authorCameron Gutman <aicommander@gmail.com>
Wed, 11 Jan 2012 23:38:48 +0000 (23:38 +0000)
committerCameron Gutman <aicommander@gmail.com>
Wed, 11 Jan 2012 23:38:48 +0000 (23:38 +0000)
- Delete the existing default gateway when releasing DHCP IP or transitioning to static IP
- Fixes bug #6205

svn path=/branches/wlan-bringup/; revision=54913

dll/win32/dhcpcsvc/dhcp/api.c

index 02add50..26723f9 100644 (file)
@@ -102,6 +102,8 @@ DWORD DSReleaseIpAddressLease( PipeSendFunc Send, COMM_DHCP_REQ *Req ) {
     if( Adapter ) {
         if (Adapter->NteContext)
             DeleteIPAddress( Adapter->NteContext );
+        if (Adapter->RouterMib.dwForwardNextHop)
+            DeleteIpForwardEntry( &Adapter->RouterMib );
 
         proto = find_protocol_by_adapter( &Adapter->DhclientInfo );
         if (proto)
@@ -170,6 +172,9 @@ DWORD DSStaticRefreshParams( PipeSendFunc Send, COMM_DHCP_REQ *Req ) {
     if( Adapter ) {
         if (Adapter->NteContext)
             DeleteIPAddress( Adapter->NteContext );
+        if (Adapter->RouterMib.dwForwardNextHop)
+            DeleteIpForwardEntry( &Adapter->RouterMib );
+        
         Adapter->DhclientState.state = S_STATIC;
         proto = find_protocol_by_adapter( &Adapter->DhclientInfo );
         if (proto)