Index: components/wifi/wifi_service_win.cc |
diff --git a/components/wifi/wifi_service_win.cc b/components/wifi/wifi_service_win.cc |
index 05371cffc74aaa75cd8a500a4e3e68c583fe4094..c14903bf1e75f5c6184761a4fa4a362e188206e7 100644 |
--- a/components/wifi/wifi_service_win.cc |
+++ b/components/wifi/wifi_service_win.cc |
@@ -904,6 +904,8 @@ void WiFiServiceImpl::WaitForNetworkConnect(const std::string& network_guid, |
// e.g. after Chromecast device reset. Reset DHCP on wireless network to |
// work around this issue. |
error = ResetDHCP(); |
+ if (error != ERROR_SUCCESS) |
+ LOG(ERROR) << error; |
afontan
2014/04/23 21:04:16
You are logging it twice as ResetDHCP already logs
mef
2014/04/23 21:41:23
Done.
|
// There is no need to keep created profile as network is connected. |
created_profiles_.RemoveWithoutPathExpansion(network_guid, NULL); |
// Restore previously suppressed notifications. |
@@ -969,14 +971,14 @@ DWORD WiFiServiceImpl::LoadWlanLibrary() { |
// Use an absolute path to load the DLL to avoid DLL preloading attacks. |
base::FilePath path; |
if (!PathService::Get(base::DIR_SYSTEM, &path)) { |
- DLOG(ERROR) << "Unable to get system path."; |
+ LOG(ERROR) << "Unable to get system path."; |
return ERROR_NOT_FOUND; |
} |
wlan_api_library_ = ::LoadLibraryEx(path.Append(kWlanApiDll).value().c_str(), |
NULL, |
LOAD_WITH_ALTERED_SEARCH_PATH); |
if (!wlan_api_library_) { |
- DLOG(ERROR) << "Unable to load WlanApi.dll."; |
+ LOG(ERROR) << "Unable to load WlanApi.dll."; |
return ERROR_NOT_FOUND; |
} |
@@ -1040,7 +1042,7 @@ DWORD WiFiServiceImpl::LoadWlanLibrary() { |
!WlanRegisterNotification_function_ || |
!WlanScan_function_ || |
!WlanSetProfile_function_) { |
- DLOG(ERROR) << "Unable to find required WlanApi function."; |
+ LOG(ERROR) << "Unable to find required WlanApi function."; |
FreeLibrary(wlan_api_library_); |
wlan_api_library_ = NULL; |
return ERROR_NOT_FOUND; |
@@ -1096,12 +1098,21 @@ DWORD WiFiServiceImpl::OpenClientHandle() { |
DWORD WiFiServiceImpl::ResetDHCP() { |
IP_ADAPTER_INDEX_MAP adapter_index_map = {0}; |
DWORD error = FindAdapterIndexMapByGUID(interface_guid_, &adapter_index_map); |
- if (error == ERROR_SUCCESS) { |
- error = ::IpReleaseAddress(&adapter_index_map); |
- if (error == ERROR_SUCCESS) { |
- error = ::IpRenewAddress(&adapter_index_map); |
+ if (error != ERROR_SUCCESS) { |
+ LOG(ERROR) << error; |
+ return error; |
+ } |
+ error = ::IpReleaseAddress(&adapter_index_map); |
+ if (error != ERROR_SUCCESS) { |
+ if (error != ERROR_ADDRESS_NOT_ASSOCIATED) { |
+ LOG(ERROR) << error; |
+ return error; |
} |
+ DVLOG(1) << "Ignoring IpReleaseAddress Error: " << error; |
} |
+ error = ::IpRenewAddress(&adapter_index_map); |
+ if (error != ERROR_SUCCESS) |
+ LOG(ERROR) << error; |
return error; |
} |