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 to 00076af #133

Merged
merged 60 commits into from
Jan 22, 2024

Conversation

canisLupus1313
Copy link
Contributor

No description provided.

abtink and others added 30 commits December 5, 2023 10:54
This commit simplifies `ChannelMaskTlv` generation and parsing.
Notably, it ensures that when we read this TLV from a `Message` the
TLV value format is validated. The changes include:
- `Entry` class representing a channel page entry is now defined as
  a `private` nested class within `ChannelMaskTlv`.
- A shared `EntriesData::Parse()` method is added that validates and
  parses the entries in the TLV, whether the TLV value resides in a
  buffer (e.g., within `Dataset`) or in a `Message`.
- `ChannelMaskTlv::AppendTo()` method is added to construct entries
  from a given combined channel mask (for all pages) and append the
  `ChannelMaskTlv` to a given `Message`.
- `Radio::kSupportedChannelPages` is changed to an array
  (containing all supported pages) instead of mask.
- Helper functions added in `Radio`, `SupportsChannelPage()` to
  verify if a channel page is supported by the radio, and
  `ChannelMaskForPage()` to obtain the supported channel mask for
  a given page.
This commit adds `FinalizeMessageDirectTx()`, which clears the
`DirectTx` flag on a given message, updates the IPv6 counter, and
signals other modules about the transmission status(particularly for
`MleDiscoverRequest` and `MleChildIdRequest` messages so their
internal state can be updated).

This commit ensures `FinalizeMessageDirectTx()` is called in various
scenarios:
- Successful message delivery (all fragments reach destination).
- Any fragment transmission failure (frame tx failure)
- Message drop due to address query failure or malformed message.
- Message drop by queue management.
- Message eviction to prioritize higher-priority messages.

This commit also updates `DiscoverScanner` to stop an ongoing discover
scan if the "MLE Discover Request" message transmission fails with error
other than CSMA error. This is necessary because the `DiscoverScanner`
reuses the same `Message` instance for tx on different scan channels.
If the `Message` is freed (e.g., evicted), the `Message` cannot be
reused.

Finally, this commit renames `RemoveMessage()` to `EvictMessage()` to
clarify the purpose and usage of this method.
This commit documents `HandleReceive` previously called
`HandleUdpReceive`.
It is useful in case RCP needs to wait for longer than the hardcoded
value in kTxWaitUs.
This commit removes `CoapSecure::SetClientConnectedCallback()` which
is the same as `SetConnectedCallback()`.
mLinkRequestAttempts is not initialized to zero causing it to get a
random value during power cycle. This causes MTD thread device to send
linkrequest after power cycle.

Create a thread network with two devices with DUT with mode rn. Reset
both devices simultaneously, enable leader and then child device
(DUT). Because class member variable mLinkRequestAttempts is not
initialized to zero during initialization, it will get random value,
and value greater than zero will lead to send a link request message
which should not be the case for a MTD device.
This commit adds `SetState()` in `SecureTransport` class which
also logs the state changes. New helper methods `IsState{}()` is also
added to simplify the code.
This commit adds cli `debug` command. This command is specifically
designed for testing and debugging purposes. It executes a series of
CLI commands to gather information about the device and thread
network.
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.1.0 to 5.0.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@93397be...0c52d54)

---
updated-dependencies:
- dependency-name: actions/setup-go
  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>
…tdata (#9599)

This commit adds `RioAdvertiser` component to `RoutingManager`, which
manages the list of prefixes advertised as RIO in emitted RA messages
by BR. The RIO prefixes are discovered from on-mesh prefixes in
Thread Network Data, including OMR prefixes from `OmrPrefixManager`
and other prefixes. Existing code for maintaining the list, appending
RIOs, and determining/setting the RIO preference is moved to the
`RioAdvertiser` class.

The `RioAdvertiser` adds a new mechanism to deprecate prefixes removed
from Network Data such that any removed prefix is still advertised as
RIO in emitted RA messages up to a deprecation interval of 300
seconds (using a shorter route lifetime in RIO). This mechanism
ensures that when an OMR prefix is withdrawn, traffic can still be
routed during deprecation time from AIL to Thread devices using the
old OMR address.

This commit also updates `test_routing_manager` to validate the new
behavior.
* Adding aliases for TCP and SRP concepts guides

* TCP and SRP concept guides now referenced by Command Ref CLIs
…(#9703)

This commit adds `OmrPrefixManager::ShouldAdvertiseLocalAsRio()` which
determines whether the local OMR prefix should be advertised as RIO
in emitted RAs. To advertise, we must have decided to publish it, and
it must already be added and present in the Network Data. This
ensures that we only advertise the local OMR prefix in emitted RAs
when, as a Border Router, we can accept and route messages using an
OMR-based address destination, which requires the prefix to be
present in Network Data. Similarly, we stop advertising (and start
deprecating) the OMR prefix in RAs as soon as we decide to remove it.
After requesting its removal from Network Data, it may still be
present in Network Data for a short interval due to delays in
registering changes with the leader.
This ensures that the function defined in the unit test would be
correctly picked over weak implementations.
…. (#9696)

Commit adds check to `otPlatUdpBindToNetif` if backbone interface is
set to correct value to prevent `setsockopt` from crashing the
ot-daemon.
Allow selection of the platform power calibration feature at build time.
Allow selection of the POSIX runtime configuration file feature
at build time.
OpenThread defines a structure to supply runtime configuration files
on a POSIX platform. These runtime configuration files contain factory
and product configuration information. They can include information
such as radio target power, region, and calibration settings.

By default, OpenThread uses an example file located at
`src/posix/platform/openthread.conf.example`. However, the file
location can be modified by supplying a pre-processor definition.

This approach has a few flaws:
- The pre-processor definitions are not accessible outside of the
  OpenThread project structure.
- In order to change the values in project, a new header file must
  be provided, the existing one modified, or the value forcibly set
  in the OpenThread cmake file.

This change introduces OT_POSIX_FACTORY_CONFIG and OT_POSIX_PRODUCT_CONFIG
to the project cmake structure. These values allow projects that are
using OpenThread as a sub-project to pass in these runtime config paths
at compile time. This offers project maintainers flexibility in how
their project is configured.
Should be checking for definition rather than value.

Also prefer `#ifdef` over `#if defined`
When compiling `mRadioUrl=aUrl` in `Radio::Init()`, some compilers may
implicitly convert `aUrl` to a temporary `RadioUrl` object and then
copy the temporary `RadioUrl` to `mRadioUrl` via a default copy
constructor. The pointer members of `mRadioUrl` point to the content
of the temporary `RadioUrl`, and it eventually causes the program to
access the memory that has been released, which causes the program to
crash.

This commit disables the compiler from implicitly converting `aUrl` to
a `RadioUrl` object and deletes the default copy and move
constructors.
Bumps [docker/login-action](https://github.com/docker/login-action) from 2.2.0 to 3.0.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@465a078...343f7c4)

---
updated-dependencies:
- dependency-name: docker/login-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>
`OPENTHREAD_ENABLE_SPINEL_VENDOR_HOOK` was not consistent with the
intended `OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK`.

Rename `OPENTHREAD_SPINEL_CONFIG_ENABLE_VENDOR_HOOK` to
`OPENTHREAD_SPINEL_CONFIG_VENDOR_HOOK_ENABLE` for consistency with
other configs.
OpenThread forks typically inherit all commits in the repo, including
the `dependabot` changes, so it's not needed to generate the same PRs
in the forks as well.
This commit introduces template variants for `ReadName()` and other
related methods, allowing flexible reading of DNS names and labels
from messages into a given array buffer. This simplifies the code and
improves readability.

Additionally, this commit defines new types, `Dns::Name::Buffer` and
`Dns::Name::LabelBuffer`, as arrays of char with fixed sizes to hold
DNS names and labels, respectively.
This commit adds net role 'DISABLED' into `spinel_net_role_t` to
differentiate between 'DISABLED' and 'DETACHED' status of NCP.

Since this is only used for NCP and not related with RCP, the
`RCP_API_VERSION` is not updated.
abtink and others added 25 commits December 26, 2023 07:51
…er (#9740)

Also updates the unit test to validate the new method.
This commit updates `ExtractLabels()` documentation to clarify that
name and suffix name can include or exclude the trailing dot but both
inputs must follow the same style. It also updates `test_dns` unit
test to validate this behavior.
This commit introduces a new method, `Name::CompareMultipleLabels()`,
to efficiently parse and compare multiple DNS name labels directly
from a message. This is then used to optimize `Name::Matches()`
eliminating the need to read the entire name into a separate buffer.

This commit also updates `Name::Matches()` method to treat the
first label as a single label allowing it to include dot character
(which is useful for service instance label).

Additionally, `test_dns` unit test is updated to validate the
functionality of the new methods.
…#9755)

Bumps [pycryptodome](https://github.com/Legrandin/pycryptodome) from 3.17 to 3.19.1.
- [Release notes](https://github.com/Legrandin/pycryptodome/releases)
- [Changelog](https://github.com/Legrandin/pycryptodome/blob/master/Changelog.rst)
- [Commits](Legrandin/pycryptodome@v3.17.0...v3.19.1)

---
updated-dependencies:
- dependency-name: pycryptodome
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Create OT API to support trel telemetry which is supported through
platform API and also add cli support to get/reset trel counters.

Metrics we are adding are:
- trel_frames_tx
- trel_bytes_tx
- trel_frames_rx
- trel_bytes_rx
- trel_frames_tx_failed
- num_trel_peers

Metrics already supported through API:
- trel_enabled
Config `OPENTHREAD_CONFIG_SRP_CLIENT_AUTO_START_DEFAULT_MODE` is
changed to use `1` by default (unless explicitly overridden in
project configs).

It also updates related test scripts to utilize auto-start mode or
explicitly disable it for manual SRP client control, reflecting this
default change.
In method `ReadOrGenerateKey` removing call to `GetPublicKey`
which was unnecessary operation (value was't used afterward).
Currently, when netlink informs that the network interface is up, an
IPv4 route is added if a valid one is specified. However, elsewhere we
only add/update the route when NAT64 is actually enabled. Since IPv4
route is not useful when NAT64 is not enabled, apply the same logic when
the network interface is started.

This avoids warnings when NAT64 is compiled in but disabled:
incoming message is an IPv4 datagram but no NAT64 prefix configured, drop
…tifact (#9769)

- actions/upload-artifact from 3.1.3 to 4.0.0
- actions/download-artifact from 3.0.2 to 4.1.1
…9774)

Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2.0.0 to 4.1.0.
- [Release notes](https://github.com/geekyeggo/delete-artifact/releases)
- [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md)
- [Commits](GeekyEggo/delete-artifact@54ab544...6504143)

---
updated-dependencies:
- dependency-name: geekyeggo/delete-artifact
  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>
Adds support for responding to `MleCounterTlv` in `AppendDiagTlv()`
Processing the TLV is a received response is already implemented
and supported. Updates `test-020-net-diag` to check query of MLE
counters TLV.
Simply set retention to 1 day for coverage artifacts.
@rlubos rlubos merged commit 00076af into zephyrproject-rtos:main Jan 22, 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.