mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 21:54:33 +02:00
esp_common: Fix range of MACs for interal usage with wrong crc
Closes: https://github.com/espressif/esp-idf/issues/5937
This commit is contained in:
@@ -95,11 +95,9 @@ esp_err_t esp_efuse_mac_get_default(uint8_t* mac)
|
|||||||
// Small range of MAC addresses are accepted even if CRC is invalid.
|
// Small range of MAC addresses are accepted even if CRC is invalid.
|
||||||
// These addresses are reserved for Espressif internal use.
|
// These addresses are reserved for Espressif internal use.
|
||||||
uint32_t mac_high = ((uint32_t)mac[0] << 8) | mac[1];
|
uint32_t mac_high = ((uint32_t)mac[0] << 8) | mac[1];
|
||||||
if ((mac_high & 0xFFFF) == 0x18fe) {
|
uint32_t mac_low = ((uint32_t)mac[2] << 24) | ((uint32_t)mac[3] << 16) | ((uint32_t)mac[4] << 8) | mac[5];
|
||||||
uint32_t mac_low = ((uint32_t)mac[2] << 24) | ((uint32_t)mac[3] << 16) | ((uint32_t)mac[4] << 8) | mac[5];
|
if (((mac_high & 0xFFFF) == 0x18fe) && (mac_low >= 0x346a85c7) && (mac_low <= 0x346a85f8)) {
|
||||||
if ((mac_low >= 0x346a85c7) && (mac_low <= 0x346a85f8)) {
|
return ESP_OK;
|
||||||
return ESP_OK;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGE(TAG, "Base MAC address from BLK0 of EFUSE CRC error, efuse_crc = 0x%02x; calc_crc = 0x%02x", efuse_crc, calc_crc);
|
ESP_LOGE(TAG, "Base MAC address from BLK0 of EFUSE CRC error, efuse_crc = 0x%02x; calc_crc = 0x%02x", efuse_crc, calc_crc);
|
||||||
abort();
|
abort();
|
||||||
|
Reference in New Issue
Block a user