From f29d324691927356e27d650214aba3a6a6efda5a Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Tue, 19 Dec 2023 18:43:51 +0800 Subject: [PATCH] fix(openthread): allow setting netif_idx of udp pcb to no_index --- components/openthread/src/port/esp_openthread_udp.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/components/openthread/src/port/esp_openthread_udp.c b/components/openthread/src/port/esp_openthread_udp.c index 3598c845f7..852c0a920a 100644 --- a/components/openthread/src/port/esp_openthread_udp.c +++ b/components/openthread/src/port/esp_openthread_udp.c @@ -256,13 +256,7 @@ otError otPlatUdpBind(otUdpSocket *udp_socket) static void udp_bind_netif_task(void *ctx) { udp_bind_netif_task_t *task = (udp_bind_netif_task_t *)ctx; - struct netif* target = netif_get_by_index(task->netif_index); - if (target == NULL) { - task->err = ESP_FAIL; - ESP_LOGE(OT_PLAT_LOG_TAG, "Failed to bind udp on index%d netif", task->netif_index); - } else { - udp_bind_netif(task->pcb, target); - } + udp_bind_netif(task->pcb, netif_get_by_index(task->netif_index)); xTaskNotifyGive(task->source_task); }