Commit Graph

9019 Commits

Author SHA1 Message Date
Li Cao 02295b035f [mbedtls] change mbedtls to git submodule (#12107)
This commit changes the mbedtls repo in openthread from source code to
git submodule.

This makes it easier for mbedtls version upgrade. This PR doesn't
upgrade the mbedtls version. v.3.6.0 is stil used to ensure nothing is
broken. The original OT specific build files (BUILD.gn, CMakeLists.txt
and config) are kept and unchanged. I've verified that the headers and
sources in the list of BUILD.gn are correct.
2025-11-12 08:10:56 +01:00
Esko Dijk 9842f4bd25 [tcat] surface hash calculation internal errors to TCAT Commissioner (#12136)
Small change to surface any internal errors in the hash calculations
to the TCAT Commissioner as general error. If not done, such errors
are silently ignored and hard to diagnose in products.
2025-11-10 23:54:19 +01:00
Suvesh Pratapa 2fd9b5a8d7 [style] IWYU for border_agent_tracker.h (#12131) 2025-11-10 23:41:11 +01:00
Abtin Keshavarzian bbf2588a56 [mdns] restart probing on Register() if in conflict state (#12128)
This commit enhances mDNS to allow reprobing for registrations
currently in a conflict state. Upon an explicit `Register()` call,
the mDNS module will now restart the probing process. This allows the
device to attempt to claim the name again if the conflict has been
resolved on the network.

Unit tests are updated to verify this behavior.
2025-11-10 23:39:48 +01:00
dependabot[bot] ce1887a597 github-actions: bump docker/metadata-action from 5.8.0 to 5.9.0 (#12133)
Bumps [docker/metadata-action](https://github.com/docker/metadata-action) from 5.8.0 to 5.9.0.
- [Release notes](https://github.com/docker/metadata-action/releases)
- [Commits](https://github.com/docker/metadata-action/compare/c1e51972afc2121e065aed6d45c65596fe445f3f...318604b99e75e41977312d83839a89be02ca4893)

---
updated-dependencies:
- dependency-name: docker/metadata-action
  dependency-version: 5.9.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-10 11:44:35 +01:00
Yakun Xu a50d1a74dc [gn] enable warnings (#12121)
This commit suppresses the undefined warnings in mbedtls. To detect
such warnings in OpenThread, this commit also enables warnings check
for gn BUILD and fixes issues found.
2025-11-08 11:34:48 -08:00
Abtin Keshavarzian cfe2999c94 [dns] update Name::ValidateName() for max-length names (#12127)
`ValidateName()` did not correctly handle names that were exactly the
maximum allowed length (`kMaxNameLength`). A name of this length is
only valid if it ends with a trailing dot. Otherwise, when encoded,
the added root label causes the encoded name to exceed the
`kMaxEncodedLength` of 255 bytes.

This commit updates `ValidateName()` to enforce that any name with
length equal to `kMaxNameLength` must end with a dot character.

It also updates the `TestDnsName` unit test to verify this corrected
behavior, ensuring `ValidateName()` and `AppendName()` handle such
names consistently.
2025-11-08 11:25:23 -08:00
Abtin Keshavarzian 6cc2a57742 [fuzz] rename fuzzer source files and update cmake macro (#12125)
Rename all fuzzer source files in `tests/fuzz` from `{name}.cpp` to
`fuzz_{name}.cpp`.

Update the `ot_nexus_test` macro in `tests/fuzz/CMakeLists.txt` to
reflect this change, using `fuzz_{name}.cpp` as the source file while
naming the test `{name}-fuzzer`.

This change improves consistency and makes it easier to distinguish
fuzzer source files from other similarly named files during searches.
2025-11-08 11:02:48 -08:00
Abtin Keshavarzian ced33033e9 [dns-client] add config to bind socket to thread netif (#12085)
This commit introduces a new configuration option
`OPENTHREAD_CONFIG_DNS_CLIENT_BIND_UDP_TO_THREAD_NETIF` to control
which network interface the DNS client's UDP socket binds to.

When this config is set to 1, the socket is bound to the Thread
network interface (`Ip6::kNetifThreadInternal`).

When the config is set to 0, the socket is bound to the unspecified
network interface (`Ip6::kNetifUnspecified`), allowing DNS messages
to be sent and received over any available network interface. By
default this new config is disabled.

A new CMake option `OT_DNS_CLIENT_BIND_UDP_THREAD_NETIF` is also added
to allow easy configuration of this feature.

The test configurations are updated to ensure both behaviors are
covered.
2025-11-08 11:02:07 -08:00
Abtin Keshavarzian 75c5d220de [border-agent] inline ForwardContext::ToHeader() (#12118)
Remove the `CoapDtlsSession::ForwardContext::ToHeader()` helper method
and move its logic directly into the `HandleCoapResponse()` method.
This simplifies the implementation by removing an unnecessary function
call for a single-use case.

Additionally, convert `ForwardContext` from a `class` to a `struct`.
This change makes the constructor public, removing the need for a
`friend` declaration for `Heap::Allocatable`, and better reflects its
role as a simple data structure.
2025-11-07 14:22:27 -08:00
Abtin Keshavarzian 74ba475914 [border-agent] move TXT data management to TxtData class (#12120)
Moves the management of MeshCoP service TXT data from the
`BorderAgent::Manager` class into the `TxtData` class.

This change improves separation of concerns by isolating all TXT
data-related logic, including vendor TXT data, change callbacks, and
notifier event handling, within the `TxtData` class. The
`BorderAgent::Manager` is simplified and its responsibilities are
more focused.

A new public method, `Refresh()`, is introduced on `TxtData` to
provide a clear API for other modules to signal that the MeshCoP
service TXT data needs to be re-evaluated and updated.
2025-11-07 14:21:10 -08:00
Abtin Keshavarzian 324f27dd44 [border-agent] rename callback to HandleLeaderResponseToFwdTmf (#12119)
The `HandleCoapResponse` callback in `CoapDtlsSession` is renamed to
`HandleLeaderResponseToFwdTmf`.

The new name more clearly indicates that this callback is used to
handle the response from the leader for a forwarded TMF message.
This improves code readability and makes the role of the callback
more explicit.
2025-11-07 10:33:28 -08:00
Zhanglong Xia 959dcc258a [child] convert Neighbor to const void* for the address comparison (#12116)
When using some special configurations, the ot-cli-ftd will crash. The
crash path is `MessageFramer::PrepareMacHeaders()` ->
`Get<NeighborTable>().FindNeighbor()` ->
`Get<ChildTable>().Contains()`. The crash happens in the
`ChildTable::Contains()`. Here is the system crash message: `kernel:
traps: ot-cli-ftd[122376] trap invalid opcode ip:5640b7713b8e
sp:7ffd6425c5f0 error:0 in ot-cli-ftd[313b8e,5640b7400000+426000]`.

The root cause of the crash is that the CandidateParent is a 4 bytes
aligned class and the Child is a 8 bytes aligned class. When
converting the CandidateParent to Neighbor and then converting the
Neighbor to Child, the program will crash due to the alignment issues.

This commit replace the static_cast with the reinterpret_cast in
ChildTable::Contains() to convert a Neighbor to a Child.
2025-11-07 07:13:38 -08:00
Abtin Keshavarzian 4a0543956e [border-agent] simplify SendErrorMessage in CoapDtlsSession (#12115)
Consolidates the two overloaded `SendErrorMessage()` methods in the
`CoapDtlsSession` class into a single implementation.

The new `SendErrorMessage()` method now accepts the token information
directly, rather than a `Coap::Message` or a `ForwardContext` object.
This simplifies the call sites and removes the now-unused
`CoapCodeFromError()` helper function (the conversion is now done
in the consolidated `SendErrorMessage()`).
2025-11-07 07:11:45 -08:00
Zhanglong Xia 32f6629f84 [test] add adb interface support to expect script (#12075)
This commit adds the adb interface support to expect scripts, so that
we can easily run all expect scripts on Android devices.

Example usages: `spawn_node ${node_id} "adb" "${adb_serial_num}"`.
2025-11-05 13:38:10 -08:00
Yang Song 3c6097bf8f [nat64] enhance nat64 prefix unit test with prefix table check (#12091)
This commit enhances the `TestNat64PrefixSelection` unit test by
adding more detailed verification of the RA-discovered NAT64 prefix
table managed by `RxRaTracker`.
2025-11-05 08:24:10 -08:00
Abtin Keshavarzian 241f6cfef0 [border-agent] simplify forwarding logic to leader (#12114)
This commit simplifies the CoAP message forwarding logic within the
`CoapDtlsSession` by removing the `mPetition` and `mSeparate` boolean
flags from the `ForwardContext`.

The `Uri` of the request is now stored directly in `ForwardContext`
and used to determine the logic flow, making the code more explicit
and easier to understand.

The `ForwardToLeader()` is only used with `kUriLeaderPetition` and
`kUriLeaderKeepAlive`, both of which requires a separate
non-confirmable response in addition to an immediate CoAP Ack
(i.e., as if `mSeperate` is `true`).

This change removes the need for intermediate flags and simplifies the
implementation of `ForwardToLeader()`, `SendErrorMessage()`, and the
`ForwardContext` constructor and `ToHeader()` method. The CoAP
message initialization is now more direct, always using
`kTypeNonConfirmable` for forwarded responses and error messages.
2025-11-05 08:08:53 -08:00
Abtin Keshavarzian 8f11e4a886 [border-agent] use OwnedPtr for message management (#12104)
This commit updates the `BorderAgent` implementation to consistently
use `OwnedPtr` for managing the lifecycle of `Coap::Message` and
`Message` objects.

This change improves memory safety and simplify the code. Message
objects are now automatically deallocated when the `OwnedPtr` goes
out of scope, which eliminates all manual calls to `FreeMessage()`
and `FreeMessageOnError()`, preventing potential memory leaks and
making the code more robust.
2025-11-04 09:17:08 -08:00
Abtin Keshavarzian 916533d301 [rx-ra-tracker] use a new Events struct for callbacks (#12084)
This commit enhances `RxRaTracker` by introducing a new `Events`
struct for handling callbacks. This change replaces the previous
`HandleRxRaTrackerDecisionFactorChanged()` method with a more
versatile `HandleRxRaTrackerEvents()` that accepts the `Events`
struct as an argument.

The new `Events` struct includes boolean flags for:
- `mInitialDiscoveryFinished`
- `mDecisionFactorChanged`
- `mLocalRaHeaderChanged`

This allows `RxRaTracker` to communicate more specific events to
`RoutingManager` and `MultiAilDetector`, enabling them to take
the proper action based on the events. The `SignalTask` has been
renamed to `EventTask` to better reflect its new role in handling
these events.
2025-11-03 21:15:51 -08:00
Abtin Keshavarzian 2e25607eec [core] fix typo in rloc16 variable name (#12102)
This commit corrects a typo in the variable name `rloc16` which was
incorrectly written as `rlco16`.
2025-11-03 21:10:03 -08:00
tanyanquan 11d389fcea [csl] restart CSL timer when update last sync timestamp (#11601)
This commit involves a small enhancement for CSL to optimize for power
consumption after receiving a frame.

Original implementation: 
- schedule next CSL window during current CSL timer handle
- even if a frame is received, the scheduled CSL timer is not reset
- SSED wakes up much earlier than required if elapsed time is large

Suggested implementation:
- recalculate CSL timer during `UpdateCslLastSyncTimestamp` if it is
  currently running
- SSED can use updated mCslLastSync so that it does not wake up much
  earlier after receiving a frame
2025-11-03 21:09:47 -08:00
dependabot[bot] 111db8a8a6 github-actions: bump ossf/scorecard-action from 2.4.2 to 2.4.3 (#12095)
Bumps [ossf/scorecard-action](https://github.com/ossf/scorecard-action) from 2.4.2 to 2.4.3.
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](https://github.com/ossf/scorecard-action/compare/05b42c624433fc40578a4040d5cf5e36ddca8cde...4eaacf0543bb3f2c246792bd56e8cdeffafb205a)

---
updated-dependencies:
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-03 08:05:43 -08:00
Abtin Keshavarzian 687cc36648 [mdns] use different default TTLs for addr and service records (#12086)
This commit updates the default TTL values used for mDNS records to
better align with the recommendations.

Previously, a single `kDefaultTtl` of 120 seconds was used for all
records when the registered entry did not explicitly specify the TTL
to use. This commit introduces separate default TTLs:

- `kDefaultAddrTtl` for address records (`AAAA`, `A`) is kept at
  120 seconds.
- `kDefaultServiceTtl` for all service records (`PTR`, `SRV`, `TXT`)
  is set to 4500 seconds.
- `kDefaultKeyTtl` is also updated to 4500 seconds for `KEY` records.

The code is updated to use the appropriate default TTL based on the
record type.
2025-10-31 10:19:05 -07:00
Li Cao bbc73280ba [ncp] implement ncp platform dnssd discovery methods (#12068)
This commit implements `otPlatDnssdStartBrowser` and
`otPlatDnssdStopBrowser` to support service discovery on NCP.

The platform APIs are intended to be used by
`ServiceDiscovery::Server::DiscoveryProxy` for discovery
functionality. This commit only supports browser for now and will
suppport Srv/Txt/Address resolver in other commits to avoid this
commit from being too large.

This commit contains these changes:
* Add new spinel property for starting / stopping service browser
* Implement encoding/decoding of the new property
* Add unit test for encoding/decoding
* Implement ncp version of dnssd platform API
  `otPlatDnssdStartBrowser` and `otPlatDnssdStopBrowser`
* Add property handler to get browser result on NCP side
* Add unit test to verify that the browser callback is correctly
  invoked after getting browser result.
2025-10-31 07:37:18 -07:00
Yang Song 4e2a570d0e [nat64] add support for RFC8781 NAT64 prefix (#12012)
This commit introduces support for discovering NAT64 prefixes as
specified in RFC 8781.

The key changes include:
- New `Nat64PrefixInfoOption`: A new `Nat64PrefixInfoOption` class is
  added to represent the PREF64 option in ND messages. This handles
  parsing the prefix and its lifetime from incoming RAs.
- `RxRaTracker` Enhancement: The `RxRaTracker` is updated to process
  `Nat64PrefixInfoOption` from RAs. It now maintains a list of
  discovered NAT64 prefixes from routers on the infrastructure link
  and determines a "favored" prefix among them.
- `RoutingManager` Update: The `Nat64PrefixManager` is enhanced to
  utilize the RA-discovered prefix.
- `test_routing_manager` Update: The `TestNat64PrefixSelection` is
  updated to include cases with RA-discovered prefixes.
2025-10-31 07:35:36 -07:00
Abtin Keshavarzian 537d790c0d [rx-ra-tracker] add state to track initial router discovery process (#12080)
Adds a new state, `mInitialDiscoveryFinished`, to `RxRaTracker` to
track the completion of the initial router discovery (RS transmission)
process. A new method, `IsInitialRouterDiscoveryFinished()`, exposes
this state.

This new method replaces `IsRsTxInProgress()`, which previously
checked if any RS transmission was ongoing. The new model ensures
the initial discovery is tracked only once after `RxRaTracker`
starts, rather than every time RS messages are sent (e.g., due to
stale timer expiration).

Additionally, the `RoutingManager` now checks this state and ignores
incoming RS messages until the initial router discovery is complete.
This prevents the BR from replying to its own RS messages or sending
an RA prematurely with incomplete information before all routers
are discovered and decision factors are determined.
2025-10-31 07:14:34 -07:00
xusiyu 9190f961f6 [ip6] bypass filtering for multicast addresses larger than RealmLocal (#12074)
Multicast addresses with scope larger than `RealmLocal` are no longer
subject to the standard receive filter. They are passed directly to
the host callback, allowing delivery and forwarding by the host.

This fixes a scenario where a `Thread Border Router` receives a
larger-scope multicast from a `Thread Device`. Previously, if the
Border Router was listening on the same multicast address and port,
the receive filter could drop the packet, preventing it from being
forwarded to other interfaces.
2025-10-30 13:34:43 -07:00
Esko Dijk e4479fb6b1 [tcat] add TCAT_ENABLE.req TMF command (#12013)
This adds support for the TMF command to enable TCAT remotely.  A test
is added that uses the 'UDP send' mechanism to send the new TMF
command to a target node.

Some fixes/additions to the test framework are made to support the new
test, including a new argument for udp_send() to send a specific byte
array and udp_rx() to receive data by a UDP client on a node.
2025-10-29 08:29:09 -07:00
Abtin Keshavarzian 13e7c4e702 [multi-ail-detector] use direct callback from RxRaTracker (#12077)
This commit introduces a direct callback mechanism from `RxRaTracker`
to `MultiAilDetector` to signal changes in decision factors. This is
in preparation of future changes allowing `MultiAilDetector` to run
independently of `RoutingManager`.

Previously, `RxRaTracker` would signal `RoutingManager`, which in turn
would call `MultiAilDetector::Evaluate()`. This commit refactors this
interaction by adding a new `HandleRxRaTrackerDecisionFactorChanged()`
method to `MultiAilDetector`.
2025-10-28 14:54:59 -07:00
Abtin Keshavarzian 3e9aeae1b6 [rx-ra-tracker] use mIsRunning in stale timer callback (#12076)
`RxRaTracker` can run independently of `RoutingManager`. Its stale timer
callback should check its own running state (`mIsRunning`) instead of
`RoutingManager`'s state.

This commit corrects the logic in `HandleStaleTimer()` to use the local
`mIsRunning` flag.
2025-10-28 14:53:52 -07:00
Abtin Keshavarzian eede70c0ef [mle] use ChildUpdateResponseInfo to pass parameters (#12073)
This commit introduces the `ChildUpdateResponseInfo` struct to
encapsulate parameters for sending "Child Update Response" messages.

The new struct holds the list of TLVs to include, the received
challenge, and the destination address.

Related methods such as `SendChildUpdateResponse()` are updated to use
the new struct. This simplifies the method signatures by reducing the
number of arguments and improves code clarity by grouping related
data.
2025-10-28 14:17:01 -07:00
Abtin Keshavarzian ca3e4d50fc [mle] ensure sender and destination are link-local in HandleUdpReceive (#12072)
Verifies that the peer and socket addresses in `Mle::HandleUdpReceive`
are link-local. This ensures that MLE messages are only processed
from link-local addresses, which is a requirement of the Thread
specification.
2025-10-28 12:32:47 -07:00
Zhanglong Xia 4cced2e81e [mac] adds the wake-up identifier to the Connection IE (#11907)
The P2P peer can be woken up using the wake-up identifier. The wake-up identifier
is included in the Connection IE. This commit implements methods to the Connection IE
and Frame to process wake-up identifier.
2025-10-28 11:01:19 -07:00
Abtin Keshavarzian ce17d9e6a9 [doc] add API re-entrancy and error handling rules (#12057)
Adds two important notes to the main API documentation header to clarify
critical usage rules for all OpenThread APIs.

- The first note states that all API calls and callbacks must be
invoked from the same OS context (e.g., the same thread).
- The second note clarifies the behavior of output parameters when an
  API call returns an error.
2025-10-28 08:56:04 -07:00
Abtin Keshavarzian a495e4a395 [border-router] call RxRaTracker message handlers from InfraIf (#12055)
This change modifies the handling of incoming ICMPv6 ND messages on the
infrastructure interface. `InfraIf::HandledReceived()` now inspects the
message type and calls the appropriate handler directly.

- Router Advertisement (RA) and Neighbor Advertisement (NA) messages are
  now passed directly to `RxRaTracker::HandleRouterAdvertisement()` and
  `RxRaTracker::HandleNeighborAdvertisement()` respectively.

- The generic `RoutingManager::HandleReceived()` method is removed.
  `RoutingManager` now only handles Router Solicit (RS) messages via
  `RoutingManager::HandleRouterSolicit()`.

This simplifies code and gives `RxRaTracker` direct ownership of RA
and NA processing, which aligns better with its role of tracking
information from received RAs and allowing it to run independently of
the `RoutingManager`.
2025-10-28 08:47:45 -07:00
jamesluo11 f52cf29454 [readme] add Beken to who-supports-openthread list (#12035) 2025-10-27 17:03:27 -07:00
Abtin Keshavarzian 5a39715e0c [border-router] move MultiAilDetector to separate files (#12067)
This change moves the `MultiAilDetector` class from being a nested
class within `RoutingManager` to its own dedicated `.hpp` and `.cpp`
files.

An instance of `MultiAilDetector` is now owned by the top-level
`Instance` class, making it a sibling component to `RoutingManager`
and other core components.

This is purely a code organization change and introduces no functional
or logic changes. This prepares for future changes where
`MultiAilDetector` may operate independently of `RoutingManager`.
2025-10-27 16:55:46 -07:00
Abtin Keshavarzian 4fdd08111e [border-router] manage RxRaTracker state via multiple requesters (#12050)
This change introduces a mechanism to control the `RxRaTracker` from
multiple sources.

A new method `RxRaTracker::SetEnabled()` is added, which accepts a
`Requester` enum. The tracker now maintains separate enable flags for
each requester (e.g., `RoutingManager`).

The `RxRaTracker` will start only when at least one requester has
enabled it AND the infrastructure interface is initialized and running.
It stops when all requesters have disabled it or when the interface
goes down.

The `Start()` and `Stop()` methods are now private, managed by a new
`UpdateState()` method to centralize the state logic. `InfraIf` is
updated to notify `RxRaTracker` of state changes.
2025-10-27 16:54:47 -07:00
Li Cao ad3035b91d [tests] add dnssd api implementations in FakePlatform (#12070)
This commit adds fake implementations for OT dnssd platform APIs.

The background is that I'm trying to enable the OT Dnssd Server
functions (Discovery Proxy) in ot-br-posix by default. Once it's
enabled, `openthread-ftd` needs implemenation of dnssd platform
APIs. To make some unit tests (in ot-br-posix) build successfully,
these fake implementations are required.
2025-10-27 16:52:02 -07:00
dependabot[bot] 138eda225b github-actions: bump actions/upload-artifact from 4.6.2 to 5.0.0 (#12069)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.2 to 5.0.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/ea165f8d65b6e75b540449e92b4886f43607fa02...330a01c490aca151604b8cf639adc76d48f6c5d4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-27 11:22:42 -07:00
Abtin Keshavarzian ae54e4a133 [mle] centralize ChildUpdate reject response logic (#12066)
Introduces a new private method `Mle::SendChildUpdateRejectResponse()`
to consolidate the logic for sending a reject response to a
"Child Update Request".

This new method creates a response containing the Source Address TLV,
Status TLV, and (if applicable) Response TLV.

The new method is now used in `Mle::HandleChildUpdateRequestOnChild()`
when the device is not a parent of the sender, and in
`Mle::HandleChildUpdateRequestOnParent()` when a request from an
unknown child is received. This change removes duplicated code from
both locations.
2025-10-27 10:57:47 -07:00
Zhanglong Xia fc71e69f92 [meshcop] check mbedtls version to ensure mbedtls_ssl_key_export_type is defined (#12053)
The macro MBEDTLS_SSL_EXPORT_KEYS is added to OT in PR #7025, it is used to
ensure mbedtls_ssl_key_export_type is defined. However, the macro
MBEDTLS_SSL_EXPORT_KEYS has been removed from the mbedtls since mbedtls-3.1.0.
If developers use external mbedtls repo with version 3.1.0 or higher
versions, and missed to define MBEDTLS_SSL_EXPORT_KEYS, it will cause
the KEK won't be set to the KeyManager.

This commit checks whether the mbedtls version is equal to or higher than
3.1.0 to ensure mbedtls_ssl_key_export_type is defined.
2025-10-27 10:54:26 -07:00
Abtin Keshavarzian 76f905bfac [mle] reuse challenge during child role restoration (#12065)
Ensure the same challenge is used for all "Child Update Request"
messages sent to the parent while trying to restore the previous
child role.

The challenge is now generated once when the child role restoration
process starts in `PrevRoleRestorer::Start`. This prevents a
situation where a new challenge from a retry could invalidate a
delayed but valid response from the parent that contained the
previous challenge.
2025-10-27 10:31:04 -07:00
Abtin Keshavarzian 9520760ff1 [mle] simplify MLE StatusTlv (#12064)
This commit simplifies the `StatusTlv` definitions. It introduces a
new `Status` enum representing the the MLE status values.
2025-10-27 10:30:28 -07:00
Yang Song ed0a6d46a5 [cmake] add build option for minimum DHCPv6 PD lifetime (#12063)
Add `OT_BORDER_ROUTING_DHCP6_PD_MIN_LIFETIME ` cmake build option, to
allow customizing the dhcpv6 pd client's minimum lifetime requirement
for different network environments or testing scenarios.
2025-10-27 09:27:32 -07:00
Zhanglong Xia 317321fef2 [api] add API to extract an extended address from an IPv6 address (#11933)
The application of the P2P module may only record the P2P peer's
link-local address for communication. This commit adds an API to
convert the peer's link-local unicast address to the peer's extended
address for tearing down the P2P link.
2025-10-27 09:26:31 -07:00
Abtin Keshavarzian 35cacd6d5f [nexus] enable CLI logging for fuzz tests (#12058)
Adds CLI related configs within the Nexus test build
(`openthread-core-nexus-config.h`) to support fuzz testing of
the CLI module.

The following configurations are added:

- `OPENTHREAD_CONFIG_CLI_MAX_LINE_LENGTH` is increased to 800 to
  handle potentially long input strings generated by the fuzzer
  without truncation.

- `OPENTHREAD_CONFIG_CLI_LOG_INPUT_OUTPUT_ENABLE` is enabled to log all
  input and output through the CLI. This is helpful for debugging
  and analyzing fuzzer-generated logs.
2025-10-24 08:12:51 +08:00
Abtin Keshavarzian b492922a9c [border-router] centralize infra-if management in InfraIf (#12046)
This change moves the management of the infrastructure interface state
out of the `RoutingManager` and centralizes it within the `InfraIf`
class. This makes `InfraIf` a more self-contained component and
simplifies the logic in `RoutingManager`.

The `RoutingManager` now depends on an initialized `InfraIf`. Its
`Init()` method is simplified and is now called from
`InfraIf::Init()`.

The public API `otBorderRoutingInit()` now directly initializes the
`InfraIf`. The `InfraIf::Init()` method is updated to support
re-initialization, allowing to switch to a new interface. When
switching, it ensures that components on the previous interface are
stopped before restarting on the new one.
2025-10-24 06:55:11 +08:00
tanyanquan 36b14d3ef7 [dhcp6-pd-client] allow custom values for kMinPreferredLifetime and kMaxPreferredLifetime (#12054) 2025-10-22 16:18:20 +08:00
Zhanglong Xia 6469b1e816 [api] add API to convert an extended address to a link-local unicast IPv6 address (#11932)
After the P2P link is established, the P2P peer's extended address is
returned as the P2P handle. This commit adds an API to convert the
peer's extended address to the peer's link-local unicast address.
2025-10-22 16:16:45 +08:00