wifi: Prevent returning an invalid factory MAC address
This is the same error checking already done in wifi_ap_iface.cpp Change-Id: I2183e6ec13a15141dc638dc8d68fda6b3afa5aa4
This commit is contained in:
parent
7bfe3131a6
commit
40e57ca717
1 changed files with 4 additions and 0 deletions
|
@ -636,6 +636,10 @@ std::pair<WifiStatus, std::array<uint8_t, 6>>
|
|||
WifiStaIface::getFactoryMacAddressInternal() {
|
||||
std::array<uint8_t, 6> mac =
|
||||
iface_util_.lock()->getFactoryMacAddress(ifname_);
|
||||
if (mac[0] == 0 && mac[1] == 0 && mac[2] == 0 && mac[3] == 0 &&
|
||||
mac[4] == 0 && mac[5] == 0) {
|
||||
return {createWifiStatus(WifiStatusCode::ERROR_UNKNOWN), mac};
|
||||
}
|
||||
return {createWifiStatus(WifiStatusCode::SUCCESS), mac};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue