From b5b17ba3965d325c172f16cbad86ce5a1f5d025b Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Tue, 4 Jun 2024 15:45:32 -0700 Subject: [PATCH] [mle] allow appending pending timestamp TLV with zero seconds (#10327) 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. --- src/core/meshcop/dataset_updater.cpp | 1 - src/core/thread/mle.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/core/meshcop/dataset_updater.cpp b/src/core/meshcop/dataset_updater.cpp index ed5d7f1d3..fb0a0ef8e 100644 --- a/src/core/meshcop/dataset_updater.cpp +++ b/src/core/meshcop/dataset_updater.cpp @@ -93,7 +93,6 @@ Error DatasetUpdater::RequestUpdate(Dataset &aDataset, UpdaterCallback aCallback if (!pendingTimestamp.IsValid()) { pendingTimestamp.Clear(); - pendingTimestamp.SetSeconds(1); } pendingTimestamp.AdvanceRandomTicks(); diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 50ae43db2..bafae24e0 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -4742,7 +4742,7 @@ Error Mle::TxMessage::AppendPendingTimestampTlv(void) Error error = kErrorNone; const MeshCoP::Timestamp ×tamp = Get().GetTimestamp(); - VerifyOrExit(timestamp.IsValid() && timestamp.GetSeconds() != 0); + VerifyOrExit(timestamp.IsValid()); error = Tlv::Append(*this, timestamp); exit: