Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

regular openthread upmerge 3873c6f #158

Merged
merged 250 commits into from
Jun 10, 2024
Merged

Conversation

canisLupus1313
Copy link
Contributor

No description provided.

sarveshkumarv3 and others added 30 commits February 16, 2024 10:11
This commit updates how random challenge is generated for "Child
Update Request" message sent by a parent during child restoration
(after parent reset/re-attach).

A random challenge is now generated and saved in the `Child` entry
when it is first initialized in `kRestoredState`. The
`SendChildUpdateRequest()` will use the saved challenge rather than
generating a new one.

This change prevents overwriting the saved challenge when the child is
also detached and happens to send a "Parent Request" in the window
where the parent transitions to the router/leader role and before the
parent sends the "Child Update Request". It ensures that the same
random challenge is included in both "Parent Response" and "Child
Update Response," guaranteeing proper acceptance of the
child's "Child ID request".

Co-authored-by: Abtin Keshavarzian <[email protected]>
Some files were missing during repo migration, this commit adds them.

Signed-off-by: Maciej Baczmanski <[email protected]>
Co-authored-by: Piotr Jasinski <[email protected]>
Co-authored-by: Przemyslaw Bida <[email protected]>
This commit contains the following:

- Adds support for the Vendor App URL TLV.
- Includes new public OT APIs and configurations to get and set the
  TLV value.
- Enables use of the TLV in the CLI `networkdiagnostic` command.
- Updates `test-020-net-diag-vendor-info.py` to validate the new TLV.
This commit contains smaller enhancements in `netdiag.h`:

- Changes TLV type constants to use `#define`.
- Removed unused definitions/constants.
- Move constants used by CLI module to related CLI method.
- Update comments and fix style.
On Android, the platform doesn't restrict link-local/mesh-local source
addresses when forwarding multicast packets. For multicast packets sent
from link-local/mesh-local address to scope larger than realm-local,
set the hoplimit to 1 so the packet can be delivered to host, and will
not be forwarded to infrastructure link.

The feature is guarded by OPENTHREAD_CONFIG_IP6_RESTRICT_FORWARDING_LARGER_SCOPE_MCAST_WITH_LOCAL_SRC,
set as 1 to enable.
This commit contains small changes in the CLI modules:

- Replace use of core-internal `kError` with `OT_ERROR` constants.
- Remove `#endif` comments when the corresponding `#if` is less
  than 20 lines away adhering to OT style guide.
- Adhere to single `return` policy (use `ExitNow()`).
- Avoid calling `static` method `ParseToIp6Address()` with an object.
- Smaller style fixes: New lines after variable declaration, use
  shorter local variable names, etc.
Changes `mVendorInfo` to be a member variable of `Tcat` class
instead of a static variable.
Use `NumericLimits<UintType>::kMax` constants in core files.
This commit updates `LqiAverager::Add()` to explicitly use a `uint16_t`
local variable for calculating the new running average. This prevents
potential overflows.
This commit changes how the link information is tracked for a received
message over Thread radio.

It removes the `const void *mLinkInfo` field in `otMessageInfo`.
Instead a new public API `otMessageGetThreadLinkInfo()` is added to
retrieve the `otThreadLinkInfo` from an `otMessage`.

All the `ThreadLinkInfo` properties are now directly tracked in
`Message` as part its `Metadata`. The `Message::Clone()` method is
updated to properly copy the link info from the original message to
its clones.

This change helps simplify the code, avoid passing `ThreadLinkInfo`
references. More importantly, it prevents potential errors due to
incorrect use of a pointer to stack-allocated `ThreadLinkInfo` object.
This is especially important for modules that save/enqueue `Message`
and its `Ip6::MessageInfo` for later use, ensuring link information
remains valid.
This commit introduces a new module, `simul_utils.h`, under
`simulation` platform. This module provides common utility functions,
primarily related to socket operations (for emulation of radio or
TREL interface). The new functions are used by `radio.c` and
`trel.c`, consolidating code and preventing repetition.
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.4 to 4.0.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@eaaf4be...0cfda1d)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.23.2 to 3.24.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@b7bf0a3...8a470fd)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Fixes accessing of member variables of `InfraNetif` from `static`
method `CreateIcmp6Socket()`.
This commit ensures that segfault won't happen if
`nullptr` is passed  to `StringLength()`.

Signed-off-by: Maciej Baczmanski <[email protected]>
This change makes it possible to build the `posix/platform/infra_if`
module on macOS (and other non-Linux systems). It adds guard checks
`#ifdef __linux__` around the use of `mNetLinkSocket`(used for
network interface state change detection). This allows compilation to
proceed on macOS, though equivalent functionality for detecting netif
change is not yet implemented.

This commit also adds a new `toranj-macos` workflow job to validate
that the code builds successfully with the `posix` platform.
This commit adds a new mechanism in `BorderAgent` to allow the use of
ephemeral key. New `otBorderAgentSetEphemeralKey` API is added to
allow user to set an ephemeral key. The ephemeral key is used
instead of PSKc from Operation Dataset for a given timeout duration.
New API `otBorderAgentClearEphemeralKey` allows users to cancel the
ephemeral key before its timeout expires. While the timeout interval
is in effect, the ephemeral key can be used only once by an external
commissioner to connect. Once the commissioner disconnects, the
ephemeral key is cleared, and Border Agent reverts to using PSKc.

This commit adds a callback mechanism to signal changes related to the
Border Agent's (BA) use of an ephemeral key. It is invoked when the
BA starts/stops using the key, or when parameters (e.g., port number)
change.

This commit also adds CLI command under `ba ephemeralkey` for the new
APIs along with test script validating the new APIs.
This commit contains smaller changes in the `posix` platform modules:
- Adds missing header guard checks.
- Use consistent names for header guard defines.
- Fix/update comments.
…tion (#9896)

This commit modifies the `RoutingManager` to not send any Router
Advertisements (RAs) until the initial policy evaluation has
completed.

This change leverages the `IsInitialPolicyEvaluationDone()` method
which ensures that both OMR and on-link prefixes have been
determined. Specifically, this guarantees that we wait for the
initial set of Router Solicitation (RS) messages to be sent and that
we discover all other routers on the AIL before sending the first RA.
This is because on-link prefix evaluation itself is dependent on the
`mRsSender.IsInProgress()` check that waits till all RS messages are
sent and RAs from other routers are received and processed.

Without this change, the BR could receive its own RS message,
triggering it to send an RA prematurely, potentially with incorrect
M and O flags.
This is to initialize CLI for daemon instance.

With this API, user can redirect the Vendor server CLI output when
needed, and then reset back using this API when the CLI output should
be restored.
…9895)

This commit implements a subset of `otPlatInfraIf` platform APIs in
simulation platforms using the `utilsSocket` to emulate communication
between BRs. This can be used for testing.

This commit also adds one (simple) example test case with two BRs
attached to two different network on same infra-if.
…871)

This commit makes changes/fixes to `KeyManager` regarding key switch
guard time.

Key Rotation Time updates:
- When the Key Rotation Time changes (due to security policy updates),
  the key switch guard time (`mKeySwitchGuardTime`) is also adjusted.
  It's set to 93% of the Rotation Time (rounded down).
- Immediately checks if the new rotation time indicates a rotation is
  due and keys are rotated.

New variable `mKeySwitchGuardTimer`:
- This is reset to the current guard time whenever the key sequence is
  updated.
- It decrements hourly until reaching zero.
- Key switch guard comparison is made with this value, aligning the
  implementation with the Thread specification.

`SetCurrentKeySequence()` modification:
- Now accepts a new input parameter that determines whether to apply
  or ignore the key switch guard when updating the key sequence.
- During a key rotation check (when the rotation time has passed), the
  key switch guard is ignored and we always move to the next key
  sequence number.

Other changes:
- Variables handling guard and rotation time now use `uint16_t`
  instead of `uint32_t` to align with security policy definitions.
- API and CLI command documentation for setting the "key switch guard
  time" emphasize that they are intended for testing purposes.
…9881)

This commit updates `Srp::Server` to add snooped cache entries in
address resolver cache table for all registered host addresses
received in an SRP update message.

Entries are added when an SRP update message is received directly from
a mesh device. The RLOC16 is looked up using `AddressResolver::Lookup()`
for the SRP Update message's sender IPv6 address (SRP client's address).
This leverages snoop entry created during UDP message processing
associating sender's IPv6 address with its RLOC16.

This commit adds a new test-case validating the new behavior.
- Validates that key guard time is updated to 93% of key rotation
  time when it changes.
- Checks for proper key sequence updates after key rotation
  expiration.
- Confirms key guard mechanism blocks key sequence increments
  while mesh nodes staying connected.
abtink and others added 23 commits June 3, 2024 10:18
This commit updates the determination of stale times for discovered
on-link or route prefixes. The stale time is now calculated per
unique prefix. If multiple routers advertise the same on-link or
route prefix, the stale time for the prefix is set to the latest
among all corresponding entries.

This addresses an issue in the previous implementation where, for
on-link prefixes, the stale time was determined as the latest stale
time over all on-link entries, regardless of the actual prefixes. For
route prefixes, the earliest stale time was used, also disregarding
the possibility of multiple routers advertising the same prefix.

This commit also updates the `test_routing_manager` unit test to
validate the corrected stale time calculation.
…10324)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.4 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@c850b93...65a9edc)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit updates `Timestamp::AdvanceRandomTicks()` to ensure that
the seconds value is incremented only if the ticks value overflows.
This allows their use when defining constant values.
This is used to simplify `Mle::HandleParentResponse()`.
…0332)

This commit fixes mbedTLS config where MBEDTLS_OID_C is not set
together with MBEDTLS_PK_PARSE_C in some OpenThread configurations.

Signed-off-by: Łukasz Duda <[email protected]>
`openthread-spinel-config.h` is included by many modules like
`spinel_encoder`, `spinel_decoder`. To use these modules in external
projects, we need to remove the including of
`openthread-core-config.h`.
…0334)

This commit updates and fixes how the Pending Dataset delay timer is
started. It is now started only after the timestamps are checked and
the local Pending Dataset is updated and saved to non-volatile
storage from the `LocalSave()` method.

In particular, we no longer start the delay timer from the `Save()`
method, which reads the `Dataset` from a received `Message`. This
is because we may receive a Pending Dataset with a timestamp that is
older than the currently saved local Pending Dataset. In this case,
the local Dataset is correctly not updated but without this change,
we could start the delay timer for the received stale Pending
Dataset.
This commit renames the entry stale time constant to `kStaleTime` and
sets it to 10 minutes (from 30 minutes). This change aligns the
`RoutingManager` with the recommended value in the latest stub router
RFC draft (`STALE_RA_TIME`).

The unit test `test_routing_manager` is also updated to reflect this
new constant.
Currently, sending an IPv6 multicast destined packet encoded in
otMessage with the otIp6Send() function reports an error kErrorNoRoute
if "host loopback allowed" flag is disabled (despite of packet being
properly passed to Mesh Forwarder). This commit changes a flag checking
statement to return kErrorNone instead.

Signed-off-by: Konrad Derda <[email protected]>
This commit adds APIs to iterate over mDNS browsers and resolvers,
along with related CLI commands. These are intended for testing. It
also introduces a build config `ENTRY_ITERATION_API_ENABLE` to
control whether the mDNS module provides mechanisms and public APIs
for entry iteration.
This commit contains minor enhancements to `HandleParentResponse()`:

- Variable name `linkMarginOut` is used for the Link Margin TLV value
  included in the response from the parent candidate. This is used to
  `SetLinkQualityOut()`.
- `twoWayLinkMargin` variable name is now used to show the two-way
  link margin.
- `IsBetterParent()` is updated to calculate the two-way link quality
  for the new parent candidate from the two-way link margin (instead
  of getting it as a parameter).
This commit introduces new helper methods in the `Dataset` class to
write or remove a Timestamp TLV (Active or Pending) to/from the
Dataset. These are added alongside the existing `ReadTimestamp()`
method.
This commit enhances the handling of `Timestamp`.

Methods `SetToInvalid()` and `IsValid()` are added to the `Timestamp`
class. The value where all bytes are set to `0xff` is used to
represent an invalid `Timestamp`. This corresponds to max seconds,
max ticks with the authoritative (`U`) flag set.

This helps simplify `DatasetManager`, where we need to track local and
network Active/Pending timestamps, which may not be present. These
are now represented by setting the `Timestamp` to the invalid value
(replacing the earlier model where a `Timestamp` pointer was used
with `nullptr` representing an invalid timestamp).

This allows us to simplify the `Timestamp::Compare()` method, now
getting two `Timestamp &` instead of `Timestamp *`. With this, we can
also define comparison operator overloads to compare two `Timestamp`
objects, which helps make the code simpler and more readable.
This commit removes the `GetSeconds() != 0` check in
`Mle::AppendPendingTimestampTlv()`. This allows `DatasetUpdater` to
use a Pending Timestamp with random ticks and a zero seconds value if
there is no pending Dataset.
This commit refactors the code for preparing and appending MLE TLVs,
moving it from `DatasetManager` to the `Mle` class for better
alignment of responsibilities.

It adds `TxMessage::AppendDatasetTlv()`, which appends an Active
or Pending Dataset (if present) to an MLE message following the
proper MLE TLV format. This includes removing the corresponding
`Timestamp` from the dataset, as MLE messages include timestamps
using their own MLE TLVs rather than within the dataset itself.
This commit adds `AppendActiveAndPendingTimestampTlvs()` helper
method, which appends both Active and Pending Timestamp TLVs to the
message. This helps simplify the code as the two TLVs are almost
always included together in different MLE messages.
This commit changes unit test `TestPrefixStaleTime()` so that a route
prefix is advertised with a lifetime of 800 seconds, which is longer
than the `kStaleTime` of 600 seconds. With this change, the entry
will not expire and become stale at the same time. This simultaneous
expiration could cause issues depending on the order of execution of
`mStaleTimer` and `mExpirationTimer`, which would be scheduled for
the same time. With this change, the entry will still be valid (due
to the lifetime of 800 seconds) when the stale timer fires after 600
seconds. This ensures that the test runs consistently and does not
depend on the order in which timer callbacks fire.
This commit adds a RCP capability diag module for verifying the RCP's
capability. This commit is an initial commit that only tested several
Spinel commands.
This commit adds a new posix sys API `otSysInitCoprocessor` which only
initializes the platform spinel component. (Reset the co-processor and
get the type)

The intention is to let the app to get the co-processor type without
creating the otInstance. Currently only `otSysInit` can be called
which creates the otInstance. However in some cases, we don't want to
create the instance at the early stage.
Commit introduces implementation of TCAT advertisement over BLE
compliant with Thread 1.3.1 specification.
Copy link
Collaborator

@edmont edmont left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add the last commit hash to the PR title as usual?
https://github.com/zephyrproject-rtos/openthread/pulls?q=is%3Apr+is%3Aclosed++upmerge+

@canisLupus1313 canisLupus1313 changed the title regular openthread upmerge regular openthread upmerge 3873c6f Jun 7, 2024
@canisLupus1313
Copy link
Contributor Author

Can you please add the last commit hash to the PR title as usual? https://github.com/zephyrproject-rtos/openthread/pulls?q=is%3Apr+is%3Aclosed++upmerge+

Done

@rlubos rlubos merged commit 3873c6f into zephyrproject-rtos:main Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.