mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 09:39:10 -04:00
Merge branch 'bugfix/netif_zero_init' into 'master'
Zero-fill netif on alloc LwIP's `struct netif` was not zero-initialized after allocation, so `ipv6_addr_cb ` function pointer contained garbage. This caused a crash if the device was on an IPv6 capable network. Fixes https://github.com/espressif/esp-idf/issues/133, https://github.com/espressif/esp-idf/issues/147, https://github.com/espressif/esp-idf/issues/142. Source: https://github.com/espressif/esp-idf/pull/148 See merge request !289
This commit is contained in:
commit
a00762f1f9
@ -64,7 +64,7 @@ esp_err_t tcpip_adapter_start(tcpip_adapter_if_t tcpip_if, uint8_t *mac, tcpip_a
|
||||
}
|
||||
|
||||
if (esp_netif[tcpip_if] == NULL) {
|
||||
esp_netif[tcpip_if] = malloc(sizeof(struct netif));
|
||||
esp_netif[tcpip_if] = calloc(1, sizeof(*esp_netif[tcpip_if]));
|
||||
if (esp_netif[tcpip_if] == NULL) {
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user