From 871a1565d86b5a5186e51ba6bd4049094d88e52e Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Thu, 20 Oct 2016 12:26:09 -0700 Subject: [PATCH] Init Timestamp within Active/PendingTimestamp TLVs. (#849) --- src/core/thread/meshcop_tlvs.hpp | 4 ++-- src/core/thread/mle_tlvs.hpp | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/core/thread/meshcop_tlvs.hpp b/src/core/thread/meshcop_tlvs.hpp index b2638633e..8d3b8267c 100644 --- a/src/core/thread/meshcop_tlvs.hpp +++ b/src/core/thread/meshcop_tlvs.hpp @@ -942,7 +942,7 @@ public: * This method initializes the TLV. * */ - void Init(void) { SetType(kActiveTimestamp); SetLength(sizeof(*this) - sizeof(Tlv)); } + void Init(void) { SetType(kActiveTimestamp); SetLength(sizeof(*this) - sizeof(Tlv)); Timestamp::Init(); } /** * This method indicates whether or not the TLV appears to be well-formed. @@ -1192,7 +1192,7 @@ public: * This method initializes the TLV. * */ - void Init(void) { SetType(kPendingTimestamp); SetLength(sizeof(*this) - sizeof(Tlv)); } + void Init(void) { SetType(kPendingTimestamp); SetLength(sizeof(*this) - sizeof(Tlv)); Timestamp::Init(); } /** * This method indicates whether or not the TLV appears to be well-formed. diff --git a/src/core/thread/mle_tlvs.hpp b/src/core/thread/mle_tlvs.hpp index d5c0e2c46..4db4286d8 100644 --- a/src/core/thread/mle_tlvs.hpp +++ b/src/core/thread/mle_tlvs.hpp @@ -1567,7 +1567,11 @@ public: * This method initializes the TLV. * */ - void Init(void) { SetType(Mle::Tlv::kActiveTimestamp); SetLength(sizeof(*this) - sizeof(Tlv)); } + void Init(void) { + SetType(Mle::Tlv::kActiveTimestamp); + SetLength(sizeof(*this) - sizeof(Tlv)); + Timestamp::Init(); + } /** * This method indicates whether or not the TLV appears to be well-formed. @@ -1591,7 +1595,11 @@ public: * This method initializes the TLV. * */ - void Init(void) { SetType(Mle::Tlv::kPendingTimestamp); SetLength(sizeof(*this) - sizeof(Tlv)); } + void Init(void) { + SetType(Mle::Tlv::kPendingTimestamp); + SetLength(sizeof(*this) - sizeof(Tlv)); + Timestamp::Init(); + } /** * This method indicates whether or not the TLV appears to be well-formed.