Author: cgutman Date: Fri Jan 13 23:39:44 2012 New Revision: 54947
URL: http://svn.reactos.org/svn/reactos?rev=54947&view=rev Log: [NETCFGX] - Always flush default gateways because pOldConfig->Gw may be NULL if the adapter was DHCP configured
Modified: branches/wlan-bringup/dll/win32/netcfgx/tcpipconf_notify.c
Modified: branches/wlan-bringup/dll/win32/netcfgx/tcpipconf_notify.c URL: http://svn.reactos.org/svn/reactos/branches/wlan-bringup/dll/win32/netcfgx/t... ============================================================================== --- branches/wlan-bringup/dll/win32/netcfgx/tcpipconf_notify.c [iso-8859-1] (original) +++ branches/wlan-bringup/dll/win32/netcfgx/tcpipconf_notify.c [iso-8859-1] Fri Jan 13 23:39:44 2012 @@ -3230,28 +3230,25 @@ } }
- if (pOldConfig->Gw) - { - dwSize = 0; - if (GetIpForwardTable(NULL, &dwSize, FALSE) == ERROR_INSUFFICIENT_BUFFER) - { - DWORD Index; - PMIB_IPFORWARDTABLE pIpForwardTable = (PMIB_IPFORWARDTABLE)CoTaskMemAlloc(dwSize); - if (pIpForwardTable) + dwSize = 0; + if (GetIpForwardTable(NULL, &dwSize, FALSE) == ERROR_INSUFFICIENT_BUFFER) + { + DWORD Index; + PMIB_IPFORWARDTABLE pIpForwardTable = (PMIB_IPFORWARDTABLE)CoTaskMemAlloc(dwSize); + if (pIpForwardTable) + { + if (GetIpForwardTable(pIpForwardTable, &dwSize, FALSE) == NO_ERROR) { - if (GetIpForwardTable(pIpForwardTable, &dwSize, FALSE) == NO_ERROR) + for (Index = 0; Index < pIpForwardTable->dwNumEntries; Index++) { - for (Index = 0; Index < pIpForwardTable->dwNumEntries; Index++) + if (pIpForwardTable->table[Index].dwForwardIfIndex == pOldConfig->Index && + pIpForwardTable->table[Index].dwForwardDest == 0) { - if (pIpForwardTable->table[Index].dwForwardIfIndex == pOldConfig->Index && - pIpForwardTable->table[Index].dwForwardDest == 0) - { - DeleteIpForwardEntry(&pIpForwardTable->table[Index]); - } + DeleteIpForwardEntry(&pIpForwardTable->table[Index]); } } - CoTaskMemFree(pIpForwardTable); } + CoTaskMemFree(pIpForwardTable); } }