From 66f6d8c3ef664a251419d080eaa18811c7f40dab Mon Sep 17 00:00:00 2001 From: chenyudong Date: Mon, 9 Dec 2019 15:16:00 +0800 Subject: [PATCH] esp_netif: store netif before register wifi rxcb --- components/esp_wifi/src/wifi_netif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/esp_wifi/src/wifi_netif.c b/components/esp_wifi/src/wifi_netif.c index 4fc63fb21..ab2216cc3 100644 --- a/components/esp_wifi/src/wifi_netif.c +++ b/components/esp_wifi/src/wifi_netif.c @@ -136,11 +136,10 @@ esp_err_t esp_wifi_register_if_rxcb(wifi_netif_driver_t ifx, esp_netif_receive_t return ESP_ERR_NOT_SUPPORTED; } + s_wifi_netifs[wifi_interface] = ifx->base.netif; if ((ret = esp_wifi_internal_reg_rxcb(wifi_interface, rxcb)) != ESP_OK) { ESP_LOGE(TAG, "esp_wifi_internal_reg_rxcb for if=%d failed with %d", wifi_interface, ret); return ESP_ERR_INVALID_STATE; } - - s_wifi_netifs[wifi_interface] = ifx->base.netif; return ESP_OK; }