esp_modem: Fixed modem netif deinit to clear IP events

Function esp_modem_netif_clear_default_handlers() didn't unregister
event handlers from IP related events, so if the netif modem was
reinitialized the previous handler was called with already destroyed
esp_netif handle.

Closes https://github.com/espressif/esp-idf/issues/6787
pull/6882/head
David Cermak 2021-03-30 19:05:25 +02:00 zatwierdzone przez bot
rodzic 509afa839e
commit 7872057976
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -144,6 +144,15 @@ esp_err_t esp_modem_netif_clear_default_handlers(void *h)
if (ret != ESP_OK) {
goto clear_event_failed;
}
ret = esp_event_handler_unregister(IP_EVENT, IP_EVENT_PPP_GOT_IP, esp_netif_action_connected);
if (ret != ESP_OK) {
goto clear_event_failed;
}
ret = esp_event_handler_unregister(IP_EVENT, IP_EVENT_PPP_LOST_IP, esp_netif_action_disconnected);
if (ret != ESP_OK) {
goto clear_event_failed;
}
return ESP_OK;
clear_event_failed: