mirror of
https://github.com/espressif/openthread.git
synced 2025-08-06 14:52:18 +08:00
[cert-mgmt] workaround: reuse existing active/pending dataset for partial dataset from thread device (#2002)
This commit is contained in:
@ -511,15 +511,34 @@ otError DatasetManager::Set(Coap::Header &aHeader, Message &aMessage, const Ip6:
|
||||
state = StateTlv::kReject);
|
||||
|
||||
// update dataset
|
||||
// Thread specification allows partial dataset changes for MGMT_ACTIVE_SET.req/MGMT_PENDING_SET.req
|
||||
// from Commissioner.
|
||||
// Updates based on existing active/pending dataset if it is from Commissioner.
|
||||
if (isUpdateFromCommissioner)
|
||||
{
|
||||
mNetwork.Set(netif.GetActiveDataset().GetNetwork());
|
||||
// take active dataset as the update base for MGMT_PENDING_SET.req if no existing pending dataset.
|
||||
if (type == Tlv::kPendingTimestamp && mNetwork.GetSize() == 0)
|
||||
{
|
||||
mNetwork.Set(netif.GetActiveDataset().GetNetwork());
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Interim workaround for certification:
|
||||
// Thread specification requires entire dataset for MGMT_ACTIVE_SET.req/MGMT_PENDING_SET.req from thread device.
|
||||
// Not all stack vendors would send entire dataset in MGMT_ACTIVE_SET.req triggered by command as known when
|
||||
// testing 9.2.5.
|
||||
// So here would accept even if it is not entire, update the Tlvs in the message on existing mNetwork in
|
||||
// order to avoid interop issue for now.
|
||||
// TODO: remove '#if 0' condition after all stack vendors reach consensus-MGMT_ACTIVE_SET.req/MGMT_PENDING_SET.req
|
||||
// from thread device triggered by command would include entire dataset as expected.
|
||||
else
|
||||
{
|
||||
mNetwork.Clear();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
if (type == Tlv::kPendingTimestamp || !doesAffectConnectivity)
|
||||
{
|
||||
offset = aMessage.GetOffset();
|
||||
|
Reference in New Issue
Block a user