[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:
Abtin Keshavarzian
2025-10-28 12:32:47 -07:00
committed by GitHub
parent 4cced2e81e
commit ca3e4d50fc
+3
View File
@@ -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));