mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-10-30 20:51:41 +00:00 
			
		
		
		
	Merge branch 'bugfix/esp_efuse_mac_get_default_fix_mac_range_for_internal_usage' into 'master'
esp_common: Fix range of MACs for interal usage with wrong crc Closes IDFGH-4066 See merge request espressif/esp-idf!10922
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_low >= 0x346a85c7) && (mac_low <= 0x346a85f8)) { |         if (((mac_high & 0xFFFF) == 0x18fe) && (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
	 Angus Gratton
					Angus Gratton