From c5b2252e0386ea3668ae391789e3da8010a4748d Mon Sep 17 00:00:00 2001 From: David Cermak Date: Thu, 22 Oct 2020 17:48:34 +0200 Subject: [PATCH] esp-netif: Fix PPP netif event posting to include esp_netif data Closes https://github.com/espressif/esp-idf/issues/6009 --- components/esp_netif/lwip/esp_netif_lwip_ppp.c | 4 ++-- examples/protocols/pppos_client/main/pppos_client_main.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/esp_netif/lwip/esp_netif_lwip_ppp.c b/components/esp_netif/lwip/esp_netif_lwip_ppp.c index bea508da1d..b3310cd800 100644 --- a/components/esp_netif/lwip/esp_netif_lwip_ppp.c +++ b/components/esp_netif/lwip/esp_netif_lwip_ppp.c @@ -160,7 +160,7 @@ static void on_ppp_status_changed(ppp_pcb *pcb, int err_code, void *ctx) break; } if (obj->ppp_error_event_enabled) { - err = esp_event_post(NETIF_PPP_STATUS, err_code, netif, sizeof(netif), 0); + err = esp_event_post(NETIF_PPP_STATUS, err_code, &netif, sizeof(netif), 0); if (err != ESP_OK) { ESP_LOGE(TAG, "esp_event_post failed with code %d", err); } @@ -210,7 +210,7 @@ static void on_ppp_notify_phase(ppp_pcb *pcb, u8_t phase, void *ctx) esp_netif_t *netif = ctx; struct lwip_ppp_ctx *obj = netif->lwip_ppp_ctx; if (obj && obj->ppp_phase_event_enabled) { - esp_err_t err = esp_event_post(NETIF_PPP_STATUS, NETIF_PP_PHASE_OFFSET + phase, netif, sizeof(netif), 0); + esp_err_t err = esp_event_post(NETIF_PPP_STATUS, NETIF_PP_PHASE_OFFSET + phase, &netif, sizeof(netif), 0); if (err != ESP_OK) { ESP_LOGE(TAG, "esp_event_post failed with code %d", err); } diff --git a/examples/protocols/pppos_client/main/pppos_client_main.c b/examples/protocols/pppos_client/main/pppos_client_main.c index 9d6ab93d25..a3cb2ad0fe 100644 --- a/examples/protocols/pppos_client/main/pppos_client_main.c +++ b/examples/protocols/pppos_client/main/pppos_client_main.c @@ -172,7 +172,7 @@ static void on_ppp_changed(void *arg, esp_event_base_t event_base, ESP_LOGI(TAG, "PPP state changed event %d", event_id); if (event_id == NETIF_PPP_ERRORUSER) { /* User interrupted event from esp-netif */ - esp_netif_t *netif = event_data; + esp_netif_t *netif = *(esp_netif_t**)event_data; ESP_LOGI(TAG, "User interrupted event from netif:%p", netif); } }