From ebc79defd79b4a8e09a64a6f5b00c050baeca399 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Fri, 26 Jun 2026 19:13:29 +0800 Subject: [PATCH 1/4] fix(openthread): fix TREL peer discovery by selecting IPv6 from mDNS address list --- components/openthread/src/port/esp_openthread_trel.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/openthread/src/port/esp_openthread_trel.c b/components/openthread/src/port/esp_openthread_trel.c index a8efe3ffd28..670167fe27d 100644 --- a/components/openthread/src/port/esp_openthread_trel.c +++ b/components/openthread/src/port/esp_openthread_trel.c @@ -64,7 +64,12 @@ static int s_trel_event_fd = -1; static void trel_browse_notifier(mdns_result_t *result) { while (result) { - if (result->addr && result->addr->addr.type == IPADDR_TYPE_V6) { + mdns_ip_addr_t *addr = result->addr; + while (addr && addr->addr.type != IPADDR_TYPE_V6) { + addr = addr->next; + } + + if (addr) { otPlatTrelPeerInfo info; uint8_t *trel_txt = NULL; size_t trel_txt_len = 0; @@ -104,9 +109,9 @@ static void trel_browse_notifier(mdns_result_t *result) info.mTxtData = trel_txt; info.mTxtLength = trel_txt_len; info.mSockAddr.mPort = result->port; - memcpy(info.mSockAddr.mAddress.mFields.m32, result->addr->addr.u_addr.ip6.addr, OT_IP6_ADDRESS_SIZE); + memcpy(info.mSockAddr.mAddress.mFields.m32, addr->addr.u_addr.ip6.addr, OT_IP6_ADDRESS_SIZE); info.mRemoved = (result->ttl == 0); - ESP_LOGI(OT_PLAT_LOG_TAG, "%s TREL peer: address: %s, port:%d", info.mRemoved ? "Remove" : "Found", ip6addr_ntoa((ip6_addr_t*)(&result->addr->addr.u_addr.ip6)), info.mSockAddr.mPort); + ESP_LOGI(OT_PLAT_LOG_TAG, "%s TREL peer: address: %s, port:%d", info.mRemoved ? "Remove" : "Found", ip6addr_ntoa((ip6_addr_t*)(&addr->addr.u_addr.ip6)), info.mSockAddr.mPort); esp_openthread_task_switching_lock_acquire(portMAX_DELAY); otPlatTrelHandleDiscoveredPeerInfo(esp_openthread_get_instance(), &info); esp_openthread_task_switching_lock_release(); From c629a359b74d1908bed2dd74532fe7318df72865 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Wed, 24 Jun 2026 17:32:26 +0800 Subject: [PATCH 2/4] feat(openthread): update openthread submodule --- components/openthread/openthread | 2 +- .../openthread-core-esp32x-radio-config.h | 31 ++++++++++++++++++- components/openthread/sbom_openthread.yml | 2 +- components/openthread/srcs_radio.cmake | 1 + 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/components/openthread/openthread b/components/openthread/openthread index a98813b30ae..b678a4f63b6 160000 --- a/components/openthread/openthread +++ b/components/openthread/openthread @@ -1 +1 @@ -Subproject commit a98813b30ae58f9a95ece680b9cc46c3874de6ea +Subproject commit b678a4f63b6f9397d1a0fa8f31e5b8e0271a4d00 diff --git a/components/openthread/private_include/openthread-core-esp32x-radio-config.h b/components/openthread/private_include/openthread-core-esp32x-radio-config.h index 215d82f9203..3941c4cf35d 100644 --- a/components/openthread/private_include/openthread-core-esp32x-radio-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-radio-config.h @@ -280,5 +280,34 @@ #define OPENTHREAD_CONFIG_MAC_SOFTWARE_TX_TIMING_ENABLE 1 #endif +/** + * @def OPENTHREAD_CONFIG_PLATFORM_MAC_KEYS_EXPORTABLE_ENABLE + * + * Define to 1 if you want to make MAC keys exportable. + */ +#ifndef OPENTHREAD_CONFIG_PLATFORM_MAC_KEYS_EXPORTABLE_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_MAC_KEYS_EXPORTABLE_ENABLE 1 +#endif + +/** + * @def OPENTHREAD_CONFIG_CRYPTO_LIB + * + * Selects the crypto backend library for OpenThread. + * + * There are several options available + * - @sa OPENTHREAD_CONFIG_CRYPTO_LIB_MBEDTLS + * - @sa OPENTHREAD_CONFIG_CRYPTO_LIB_PSA + * - @sa OPENTHREAD_CONFIG_CRYPTO_LIB_PLATFORM + */ +#ifndef OPENTHREAD_CONFIG_CRYPTO_LIB #define OPENTHREAD_CONFIG_CRYPTO_LIB OPENTHREAD_CONFIG_CRYPTO_LIB_PSA -#define OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE 0 +#endif + +/** + * @def OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE + * + * Define to 1 if you want to enable key ref usage support as defined by platform. + */ +#ifndef OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE +#define OPENTHREAD_CONFIG_PLATFORM_KEY_REFERENCES_ENABLE 1 +#endif diff --git a/components/openthread/sbom_openthread.yml b/components/openthread/sbom_openthread.yml index 9d7a43b78f7..6d40f289e71 100644 --- a/components/openthread/sbom_openthread.yml +++ b/components/openthread/sbom_openthread.yml @@ -5,7 +5,7 @@ supplier: 'Organization: Espressif Systems (Shanghai) CO LTD' originator: 'Organization: Google LLC' description: OpenThread released by Google is an open-source implementation of the Thread networking url: https://github.com/espressif/openthread -hash: a98813b30ae58f9a95ece680b9cc46c3874de6ea +hash: b678a4f63b6f9397d1a0fa8f31e5b8e0271a4d00 cve-exclude-list: - cve: CVE-2026-8369 reason: We use Espressif’s NAT64 implementation and hence this CVE from the upstream NAT64 implementation is not applicable. diff --git a/components/openthread/srcs_radio.cmake b/components/openthread/srcs_radio.cmake index 9d929c10059..4c5a8680668 100644 --- a/components/openthread/srcs_radio.cmake +++ b/components/openthread/srcs_radio.cmake @@ -41,6 +41,7 @@ set(rcp_srcs openthread/src/core/radio/radio.cpp openthread/src/core/radio/radio_callbacks.cpp openthread/src/core/radio/radio_platform.cpp + openthread/src/core/radio/radio_types.cpp openthread/src/core/thread/link_quality.cpp openthread/src/core/utils/otns.cpp openthread/src/core/utils/parse_cmdline.cpp From 30a2d5c25d7a9c82789d149bbace7089746b105b Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Wed, 8 Jul 2026 13:01:42 +0000 Subject: [PATCH 3/4] feat(openthread): update thread-lib for upstream b678a4f6 * esp-openthread: thread_zigbee/esp-openthread@47428f1e8 * openthread: espressif/openthread@b678a4f63 * esp-idf: espressif/esp-idf@c629a359b --- components/openthread/lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/openthread/lib b/components/openthread/lib index 9467fb32078..b6ec132ceaf 160000 --- a/components/openthread/lib +++ b/components/openthread/lib @@ -1 +1 @@ -Subproject commit 9467fb320782855dff84add294039bfa0bcbbf4b +Subproject commit b6ec132ceaf84d5317b6bf78a5bb85b7cc9011ee From 1a53acb8704b9abbbd1bd9570dc4a82c7fdd2cf1 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Wed, 8 Jul 2026 22:41:21 +0800 Subject: [PATCH 4/4] fix(openthread): disable software retx security in spinel-only config --- .../openthread-core-esp32x-spinel-config.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/components/openthread/private_include/openthread-core-esp32x-spinel-config.h b/components/openthread/private_include/openthread-core-esp32x-spinel-config.h index 9e01fb818af..4f848146ccb 100644 --- a/components/openthread/private_include/openthread-core-esp32x-spinel-config.h +++ b/components/openthread/private_include/openthread-core-esp32x-spinel-config.h @@ -88,3 +88,13 @@ #ifndef OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE #define OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE 1 #endif + +/** + * @def OPENTHREAD_CONFIG_MAC_SOFTWARE_RETX_SECURITY_ENABLE + * + * Workaround for SPINEL_ONLY build configuration. + * See esp-idf MR !50530 for details. + */ +#ifndef OPENTHREAD_CONFIG_MAC_SOFTWARE_RETX_SECURITY_ENABLE +#define OPENTHREAD_CONFIG_MAC_SOFTWARE_RETX_SECURITY_ENABLE 0 +#endif