mirror of
https://github.com/espressif/openthread.git
synced 2026-07-28 06:37:46 +00:00
[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.
This commit is contained in:
@@ -139,6 +139,7 @@ typedef UintTlvInfo<ThreadTlv::kStatus, uint8_t> ThreadStatusTlv;
|
||||
/**
|
||||
* Implements Router Mask TLV generation and parsing.
|
||||
*/
|
||||
OT_TOOL_PACKED_BEGIN
|
||||
class ThreadRouterMaskTlv : public ThreadTlv, public TlvInfo<ThreadTlv::kRouterMask>
|
||||
{
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user