mirror of
https://github.com/espressif/openthread.git
synced 2026-06-05 21:14:49 +00:00
[mle] ensure sender and destination are link-local in HandleUdpReceive (#12072)
Verifies that the peer and socket addresses in `Mle::HandleUdpReceive` are link-local. This ensures that MLE messages are only processed from link-local addresses, which is a requirement of the Thread specification.
This commit is contained in:
committed by
GitHub
parent
4cced2e81e
commit
ca3e4d50fc
@@ -1573,6 +1573,9 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
LogDebg("Receive MLE message");
|
||||
|
||||
VerifyOrExit(aMessage.GetOrigin() == Message::kOriginThreadNetif);
|
||||
VerifyOrExit(aMessageInfo.GetPeerAddr().IsLinkLocalUnicast());
|
||||
VerifyOrExit(aMessageInfo.GetSockAddr().IsLinkLocalUnicastOrMulticast());
|
||||
|
||||
VerifyOrExit(aMessageInfo.GetHopLimit() == kMleHopLimit, error = kErrorParse);
|
||||
|
||||
SuccessOrExit(error = aMessage.Read(aMessage.GetOffset(), securitySuite));
|
||||
|
||||
Reference in New Issue
Block a user