From cb29bfa6b40e3be3789473c92c5da53aaf7a0508 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Fri, 26 May 2023 19:20:27 +0800 Subject: [PATCH] openthread: forbid otPlatUdp to connect to address 0.0.0.0 and port 0 --- components/openthread/src/port/esp_openthread_udp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/openthread/src/port/esp_openthread_udp.c b/components/openthread/src/port/esp_openthread_udp.c index 17f8256a38..08c8e12e6c 100644 --- a/components/openthread/src/port/esp_openthread_udp.c +++ b/components/openthread/src/port/esp_openthread_udp.c @@ -305,6 +305,9 @@ otError otPlatUdpConnect(otUdpSocket *udp_socket) }; task.addr = map_openthread_addr_to_lwip_addr(&udp_socket->mPeerName.mAddress); + if (ip_addr_isany_val(task.addr) && task.port == 0) { + return OT_ERROR_NONE; + } tcpip_callback(udp_connect_task, &task); wait_for_task_notification();