Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: components/wifi/wifi_service_win.cc

Issue 250223002: Ignore ERROR_ADDRESS_NOT_ASSOCIATED from IpReleaseAddress in WiFiService::ResetDHCP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase and format Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/wifi/wifi_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/wifi/wifi_service_win.cc
diff --git a/components/wifi/wifi_service_win.cc b/components/wifi/wifi_service_win.cc
index 130c1422fc7ac544d481c8968e1f4a18ffb40e84..db1c8b9acbac51ad5d72a35d9e40f0f1a2c9fe4b 100644
--- a/components/wifi/wifi_service_win.cc
+++ b/components/wifi/wifi_service_win.cc
@@ -906,6 +906,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;
// There is no need to keep created profile as network is connected.
created_profiles_.RemoveWithoutPathExpansion(network_guid, NULL);
// Restore previously suppressed notifications.
@@ -973,14 +975,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;
}
@@ -1044,7 +1046,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;
@@ -1100,12 +1102,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;
}
« no previous file with comments | « no previous file | components/wifi/wifi_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698