mirror of
https://github.com/espressif/openthread.git
synced 2026-08-13 14:17:47 +00:00
[mle] verify hop limit is 255 (#2167)
This commit is contained in:
@@ -1942,7 +1942,7 @@ otError Mle::SendMessage(Message &aMessage, const Ip6::Address &aDestination)
|
||||
messageInfo.SetSockAddr(mLinkLocal64.GetAddress());
|
||||
messageInfo.SetPeerPort(kUdpPort);
|
||||
messageInfo.SetInterfaceId(netif.GetInterfaceId());
|
||||
messageInfo.SetHopLimit(255);
|
||||
messageInfo.SetHopLimit(kMleHopLimit);
|
||||
|
||||
SuccessOrExit(error = mSocket.SendTo(aMessage, messageInfo));
|
||||
|
||||
@@ -2008,6 +2008,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
Neighbor *neighbor;
|
||||
|
||||
VerifyOrExit(aMessageInfo.GetLinkInfo() != NULL);
|
||||
VerifyOrExit(aMessageInfo.GetHopLimit() == kMleHopLimit);
|
||||
|
||||
length = aMessage.Read(aMessage.GetOffset(), sizeof(header), &header);
|
||||
VerifyOrExit(header.IsValid() && header.GetLength() <= length);
|
||||
|
||||
@@ -1336,6 +1336,7 @@ private:
|
||||
enum
|
||||
{
|
||||
kMleMessagePriority = Message::kPriorityHigh,
|
||||
kMleHopLimit = 255,
|
||||
};
|
||||
|
||||
void GenerateNonce(const Mac::ExtAddress &aMacAddr, uint32_t aFrameCounter, uint8_t aSecurityLevel,
|
||||
|
||||
Reference in New Issue
Block a user