From 697fb25bed94bd08c03056afee766eeb0739e828 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 26 Mar 2026 19:40:28 -0700 Subject: [PATCH] [thread-tlvs] add missing packed macros to `ThreadRouterMaskTlv` (#12769) This commit updates the `ThreadRouterMaskTlv` class definition to include the `OT_TOOL_PACKED_BEGIN` and `OT_TOOL_PACKED_END` macros. This class defines the structure of a TLV used in Thread messages and directly maps to a memory buffer. Therefore, it must be properly packed to ensure its memory footprint accurately reflects the wire format and to prevent potential memory alignment padding. Thankfully, this omission did not impact the format of this specific TLV, as the alignment of its members natively matched the packed layout. --- src/core/thread/thread_tlvs.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/thread/thread_tlvs.hpp b/src/core/thread/thread_tlvs.hpp index ef22048e1..80380d731 100644 --- a/src/core/thread/thread_tlvs.hpp +++ b/src/core/thread/thread_tlvs.hpp @@ -139,6 +139,7 @@ typedef UintTlvInfo ThreadStatusTlv; /** * Implements Router Mask TLV generation and parsing. */ +OT_TOOL_PACKED_BEGIN class ThreadRouterMaskTlv : public ThreadTlv, public TlvInfo { public: @@ -198,7 +199,7 @@ public: private: uint8_t mIdSequence; Mle::RouterIdSet mAssignedRouterIdMask; -}; +} OT_TOOL_PACKED_END; /** * Implements Thread Network Data TLV generation and parsing.