Commit Graph

6831 Commits

Author SHA1 Message Date
Jonathan Hui b9514bf025 [docs] add security policy (#8497) 2022-12-07 16:21:29 -08:00
Jonathan Hui 2bfbd6b3f5 [github-actions] add codeql workflow (#8355) 2022-12-07 14:20:28 -08:00
Abtin Keshavarzian 6f1631aeba [mle] re-attach on FTD/MTD mode changes or from rx-on to sleepy (#8484)
This commit updates behavior when device mode gets changed
so to re-attach on switching between MTD/FTD modes and also on
switching from rx-on to sleepy (rx-off) mode (when attached as a
child).

This commit also updates `test-027-child-mode-change.py` to match
the new behavior.
2022-12-07 11:11:45 -08:00
Zhangwx e609eef7cc [logging] fix print format using %lu for uint32_t variables (#8495) 2022-12-07 10:14:22 -08:00
Abtin Keshavarzian 27be812bad [mpl] use TimeTicker for aging mSeedSet entries (#8488)
This commit updates the `Ip6::Mpl` to use `TimeTicker` instead of
its own `Timer` to age the entries in its `mSeedSet`. This commit
also updates the default number of seed entries by 3 to use the
memory saved by using `TimeTicker`.
2022-12-06 16:04:57 -08:00
Zang MingJie e8b34a46a7 [cli] add platform command which returns current platform (#8444)
Sometime we need to identify which platform we are currently using,
especially in a test cases, where a unified interface is provided to
control devices, the test cases have no idea about current platform.
2022-12-06 13:23:55 -08:00
Abtin Keshavarzian 9950ccf2fa [mpl] smaller enhancements in Ip6::Mpl (#8475)
- Use MLE `GetMeshLocal16()` to check if seed ID can be elided
  (remove `mMatchingAddress).
- When processing MPL option if seed ID is elided, we ensure that
  sender's address is RLOC format and use the RLOC16 as seed ID.
- When preparing MPL option directly use device's RLOC16 as seed ID
  (removing `Mpl::Get/SetSeedId()` methods).
- Determine number of timer expirations (MPL retransmission) based
  on device's current role.
2022-12-06 12:40:10 -08:00
Abtin Keshavarzian 852bc76f48 [mpl] reset seed entry lifetime on rx/tx (#8482)
This commit updates `Mpl::UpdateSeedSet()` to reset the `SeedEntry`
lifetime to `kSeedEntryLifetime` if we rx/tx a message with same
ID and sequence. This ensures that the entry is kept in the array
while other routers are forwarding the same message.
2022-12-05 21:27:06 -08:00
Abtin Keshavarzian cf4e514d00 [netdata] ensure to update version on leader if there is any change (#8472)
This commit updates `RegisterNetdataData()` to ensure that versions
are updated if there is any change even if there is an error during
integration of new entries (e.g., running out of space in Network
Data, or failing to allocate new service ID).
2022-12-05 14:11:33 -08:00
Yi 2167fda5a8 [nat64] delete nat64_set_enabled() when starting BR in tests (#8476)
NAT64 is enabled by default.
2022-12-05 11:53:21 -08:00
Abtin Keshavarzian 27b43146a9 [mle] rename variables to indicate if they are a TLV (#8465) 2022-12-01 21:26:40 -08:00
Abtin Keshavarzian 0337ff3e7e [csl] ensure current window is not missed when preparing CSL frame (#8464)
This commit fixes how we determine the CSL timings when preparing a
frame for CSL transmission. When scheduling the next CSL, we use
`mCslFrameRequestAheadUs` time in `GetNextCslTransmissionDelay()`. We
basically schedule `Mac` to start the CSL tx operation a bit earlier
than the desired CSL tx time. In `HandleFrameRequest()` (when we are
preparing the frame to be sent) we should be already within
`mCslFrameRequestAheadUs` time from the tx time. So this commit changes
the code such that we invoke `GetNextCslTransmissionDelay()` with zero
`aAheadUs` interval when preparing the frame. This ensures that we do not
skip the current CSL window and move to the next.

This commit also adds a check in `HandleFrameRequest()` to ensure that
we did not miss the current CSL window. This situation can happen if
`Mac` happens to be busy with some other operation and therefore late
to start CSL tx and invoke `HandleFrameRequest()`. In such a case we
don't want to use delay tx time for next CSL window (which may be way
later) and instead we abort the current CSL tx operation by returning
a `nullptr` frame.
2022-12-01 21:00:17 -08:00
Abtin Keshavarzian 89e403815a [mle] update RouteTlv to check number of allocated IDs (#8463)
This commit contains smaller enhancements in `RouteTlv`:

- `RouteTlv::IsValid()` checks that number of allocated IDs in
  the Router ID Mask is less than max number of routers.
- It also checks that the TLV contains correct number of Route
  Data entries matching the number of allocated router IDs.
- A new method `SetRouteData()` is added to set all the
  data fields (link quality in/out and route cost) for a given
  router index.
- These changes help ensure that messages containing invalid
  `RouteTlv` are rejected (avoid situation where we may have
  more allocated router IDs than max routers).
2022-12-01 19:45:31 -08:00
whd 87284f22eb [netdata] increase kInfoStringSize (#8454) 2022-11-29 19:43:18 -08:00
Jonathan Hui 0759de4fc5 [dependabot] update commit message prefix (#8457) 2022-11-29 10:45:21 -08:00
Jonathan Hui e61e64d2b7 [github-actions] exclude dependabot branches (#8456) 2022-11-29 10:45:03 -08:00
Eduardo Montoya 45c2cb4332 [indirect-sender] reset CSL Tx attempts in DataPollHandler (#8455)
Fix an issue in which a CSL Transmitter would start to send malformed
frames to the radio in the ocassion of a data poll arriving while a
delayed CSL transmission was already scheduled.

Notice that `CslTxScheduler::HandleSentFrame` is reseting both CSL Tx
attempts and Indirect Tx attempts, so it makes sense to do the same
in `DataPollHandler::HandleSentFrame`.
2022-11-29 10:19:14 -08:00
andrei-menzopol 1b88b045d0 [logging] fix format strings (#8446)
This commit fixes the format string in logging functions.

When openthread is included in other projects that use the -Werror
option in their builds, such as Matter, these format string errors
appear. In this case, it can be seen in radio.h that the structure
members are uint32_t but printed with %u.

The size of types depends on the target, there needs to be a casing.
2022-11-29 08:29:52 -08:00
whd 746557d52c [build] fix LOCAL_EXPORT_CFLAGS (#8453)
`LOCAL_EXPORT_CFLAGS` is exporting `OPENTHREAD_PROJECT_CFLAGS` which
contains quotes. This sometimes can cause compile errors due to
limitation of Android build system.

Also, `ot-cli` is repeating the flags in `LOCAL_CFLAGS`, which can
cause macro redefinition error. Since `ot-cli` depends on `ot-core`,
it already gets the flags from `LOCAL_EXPORT_CFLAGS`.
2022-11-28 21:14:06 -08:00
Abtin Keshavarzian d2e1c1e14d [router-table] move FillRouteTlv() to RouterTable (#8437)
This commit moves `FillRouteTlv()` method to `RouterTable` class.
2022-11-28 21:12:21 -08:00
Abtin Keshavarzian 43a6430083 [router-table] add new helper methods FindNextHopOf() and renames (#8437)
This commit contains smaller enhancements in `RouterTable` class:

- New method `FindNextHopOf()` is added to find the next hop of a
  given router.
- Methods which find router are renamed: `FindRouterById()` to search
  for a given Router ID, `FindRouterByRloc16()` to search for a given
  RLOC16.
- The methods which find a neighbor router are declared as `private`
  and only used by `friend` class `NeighborTable`. Other modules use
  `NeighborTable` methods to find neighbors.
2022-11-28 21:12:21 -08:00
dependabot[bot] d88ea9a463 github-actions: bump actions/upload-artifact from 1 to 3 (#8448)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 1 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v1...v3)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 12:13:45 -08:00
dependabot[bot] 25d8f54d56 github-actions: bump docker/setup-buildx-action from 1 to 2 (#8447)
Bumps [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) from 1 to 2.
- [Release notes](https://github.com/docker/setup-buildx-action/releases)
- [Commits](https://github.com/docker/setup-buildx-action/compare/v1...v2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 12:13:09 -08:00
jinran-google e66c21c3da [api] include Thread version in neighbor info (#8435) 2022-11-23 21:34:13 -08:00
Abtin Keshavarzian eeb6ab0c8e [routing-manager] ensure local prefix is changed on xpanid change (#8436)
This commit updates `RoutingManager` to check if a change to xpanid
does impact the generated local on-link prefix. This can address two
situations: (1) when BR is started before Thread/MLE operation where
we can get a signal that xpanid is changed on MLE start (without it
actually changing), (2) if the xpanid does change but since not all
the xpanid bytes are used in the derivation of the local prefix, it
can remain as before.

This commit also updates the unit test to start the BR early (along
with MLE operation) under the `TestSavedOnLinkPrefixes()` case.
2022-11-22 22:04:55 -08:00
Song GUO b468a25a61 [nat64] use dbus API for NAT64 tests (#8392) 2022-11-22 21:39:11 -08:00
Abtin Keshavarzian afcc48edde [router-table] remove duplicate method (#8434)
This commit removes `RouterTable::GetActiveLinkCount()` and uses
`GetNeighborCount()` instead (which does the same).
2022-11-22 18:21:13 -08:00
Abtin Keshavarzian 2b579767ad [test] test_routing_manager to check duplicate PIO/RIO prefixes (#8431)
This commit updates the `RoutingManager` unit test to check that
there are no duplicate PIO/RIO prefixes in the emitted RA message.

It also updates the `TestSavedOnLinkPrefixes()` to check behavior
after device resets/restarts while it was advertising its local
on-link prefix or deprecating it.
2022-11-22 18:20:31 -08:00
Abtin Keshavarzian c5af37fbc7 [router-table] fix router next hop change on Release(aRouterId) (#8433) 2022-11-22 17:54:57 -08:00
Abtin Keshavarzian 4e44471431 [meshcop] update processing of UDP Encapsulation TLV (#8427)
This commit updates how UDP Encapsulation TLV is processed. In
particular, when handling a received TMF `kUriProxyTx` message
containing this TLV, we allow the TLV to be extended or not. This is
aligned with the Thread specification for this TLV. When appending
this TLV in `kUriProxyRx` TMF message, we continue to use Extended
TLV so to keep the behavior same as before.
2022-11-22 13:12:52 -08:00
Abtin Keshavarzian b102e4172c [tlv] add private helper methods to parse and find TLVs in a message (#8421)
This commit adds new private type `ParsedInfo` in `Tlv` class
which contains parsed TLV info such as TLV type, length, size,
value offset. This class provides `ParseFrom()` and `FindIn()`
methods to parse or find a TLV from a message.

This commit also adds a unit test `test_tlv` to validate the TLV
methods.
2022-11-22 12:52:21 -08:00
whd 9f702782bd [telemetry] implement RA/RS counters (#8416) 2022-11-22 09:23:58 -08:00
dependabot[bot] a8367287a5 github-actions: bump actions/download-artifact from 2 to 3 (#8426)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v2...v3)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 22:44:48 -08:00
dependabot[bot] 49cf1e1dc2 github-actions: bump docker/login-action from 1 to 2 (#8425)
Bumps [docker/login-action](https://github.com/docker/login-action) from 1 to 2.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](https://github.com/docker/login-action/compare/v1...v2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 22:44:28 -08:00
dependabot[bot] d3b3a0b5ef github-actions: bump actions/setup-python from 1 to 4 (#8424)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 1 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v1...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 22:44:07 -08:00
dependabot[bot] c8ff3ba445 github-actions: bump codecov/codecov-action from 2 to 3 (#8423)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2...v3)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 22:43:47 -08:00
dependabot[bot] 233b589cdb github-actions: bump actions/setup-go from 1 to 3 (#8422)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 1 to 3.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/v1...v3)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 22:43:21 -08:00
Ewout ter Hoeven bf33e2b4bc [github-actions] add Dependabot configuration for GitHub Actions updates (#8418)
Add a Dependabot configuration that checks once a week if the GitHub
Actions are still using the latest version. If not, it opens a PR to
update them.

It will actually open few PRs, since only major versions are specified
(like v3), so only on a major release (like v4) it will update and
open a PR. But it helps actively keep GitHub Actions workflows up to
date and secure.
2022-11-21 19:22:55 -08:00
Zhanglong Xia 5e9c7d914d [spinel] update the updating/adding RCP spinel property guideline (#7937)
When adding a new spinel property or updating the existing spinel
property, it may cause the host can't work with the old RCP. The
host can be updated independently on some of our products. If the
compatibility issue happens, it causes the host dies after the
host is updated.

To reduce the compatibility issues between the host and RCP, this
commit updates the guideline of updating/adding RCP spinel properties.
2022-11-21 08:52:56 -08:00
Abtin Keshavarzian faeea3d2b9 [tlv] helper methods to read/find/append TLVs with UTF8 string value (#8417)
This commit adds new methods in `Tlv` to read, find, or append simple
TLVs with a UTF8 string value. `StringTlvInfo<Type, kMaxStringLen>`
can be used to define constants and types for such TLVs. This helps
simplify implementation of many such TLVs, e.g., Vendor Name TLV,
Provisioning URL TLV, Network Name TLV, etc.
2022-11-18 19:49:20 -08:00
Abtin Keshavarzian 411a20a62b [mle] use Tlv::FindTlvValueOffset() instead of FindTlvOffset() (#8413)
This commit updates `Mle` modules to use `FindTlvValueOffset()`
instead of `FindTlvOffset()` when trying to find a variable length
TLV (e.g., Network Data TLV or Address Registration TLV). This helps
simplify the code (we avoid reading the TLV again and can directly
read and process the TLV's value).
2022-11-18 13:01:56 -08:00
Yakun Xu 564d667790 [doc] add doc for coex command (#8415) 2022-11-18 12:58:30 -08:00
Abtin Keshavarzian 4e83caf42d [commissioner] fix provisioning URL comparison (#8411)
This commit fixes the comparison of the received Provisioning URL
string with the commissioner's one when handling Joiner Finalize TMF
message.
2022-11-17 19:45:37 -08:00
Jonathan Hui 439a5ba234 [docker] update ubuntu to 22.04 (#8405) 2022-11-17 09:05:47 -08:00
Abtin Keshavarzian 16c6b04537 [meshcop] simplify StateTlv (#8404)
This commit simplifies `StateTlv` and updates the reading of TLV in
`DatasetManager::HandleMgmtSetResponse()` (which could previously
allow a TLV with empty value).
2022-11-17 09:05:27 -08:00
canisLupus1313 593c2b0a8d [bootstrap] remove brew from apt package installations (#8399)
This commit chages incorrect pkg manager tool used in
`install_packages_pretty_format` from brew to apt-get.
2022-11-17 08:52:22 -08:00
Abtin Keshavarzian 4a7c447f6c [cli] update OutputSpaces() to use literal format string (#8394)
This commit updates `OutputSpaces()` to use literal format string.
2022-11-16 20:28:43 -08:00
Jonathan Hui 2caab0c331 [spinel] fix printf style output (#8401) 2022-11-16 13:02:46 -08:00
Jonathan Hui dadd60f88a [github-actions] fix macos build checks (#8397)
- install `ninja` binary directly
- use pre-installed clang on macos
2022-11-15 09:14:13 -08:00
Zhanglong Xia 3e138d3f5d [diag] add gpio mode commands (#8391)
This commit adds diag commands for setting the GPIO mode to resolve
the conflict https://github.com/openthread/openthread/issues/8362.
2022-11-12 04:51:24 +01:00