diff --git a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/hal_device_manage/hal_device_manage.cpp b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/hal_device_manage/hal_device_manage.cpp index 0a3f31e1ea7357c870ae180bb7720ea13ee22544..21e49de2b966f1272eaefd3610930ae3d26d37ea 100644 --- a/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/hal_device_manage/hal_device_manage.cpp +++ b/wifi/services/wifi_standard/wifi_framework/wifi_manage/wifi_native/hal_device_manage/hal_device_manage.cpp @@ -478,18 +478,11 @@ bool HalDeviceManager::SetStaMacAddress(const std::string &ifaceName, const std: sptr &iface = iter->second; CHECK_NULL_AND_RETURN(iface, false); - if (iface->SetIfaceState(false) != HDF_SUCCESS) { - LOGE("SetStaMacAddress, set network down fail"); - return false; - } + // sta iface setMacAddress would set network down and up internally int32_t ret = iface->SetMacAddress(mac); if (ret != HDF_SUCCESS) { LOGE("SetStaMacAddress, call SetMacAddress failed! ret:%{public}d", ret); } - if (iface->SetIfaceState(true) != HDF_SUCCESS) { - LOGE("SetStaMacAddress, set network up fail"); - return false; - } LOGI("SetStaMacAddress success"); return true;