From 36be6f512a0872ec378cd7932a24a4847902f7ef Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Fri, 13 Jan 2012 23:39:44 +0000 Subject: [PATCH] [NETCFGX] - Always flush default gateways because pOldConfig->Gw may be NULL if the adapter was DHCP configured svn path=/branches/wlan-bringup/; revision=54947 --- dll/win32/netcfgx/tcpipconf_notify.c | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/dll/win32/netcfgx/tcpipconf_notify.c b/dll/win32/netcfgx/tcpipconf_notify.c index 0f8555024bb..cb521e8607e 100644 --- a/dll/win32/netcfgx/tcpipconf_notify.c +++ b/dll/win32/netcfgx/tcpipconf_notify.c @@ -3230,28 +3230,25 @@ INetCfgComponentControl_fnApplyRegistryChanges( } } - if (pOldConfig->Gw) + dwSize = 0; + if (GetIpForwardTable(NULL, &dwSize, FALSE) == ERROR_INSUFFICIENT_BUFFER) { - dwSize = 0; - if (GetIpForwardTable(NULL, &dwSize, FALSE) == ERROR_INSUFFICIENT_BUFFER) + DWORD Index; + PMIB_IPFORWARDTABLE pIpForwardTable = (PMIB_IPFORWARDTABLE)CoTaskMemAlloc(dwSize); + if (pIpForwardTable) { - 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); } }