mirror of
https://github.com/espressif/openthread.git
synced 2026-08-30 22:09:54 +00:00
[mle] no failing logs for broadcast security check (#7362)
This commit eliminates logging of broadcast security check failures because it can be common to receive such messages from ajacent Thread networks.
This commit is contained in:
+14
-2
@@ -2748,6 +2748,7 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
uint8_t tag[kMleSecurityTagSize];
|
||||
uint8_t command;
|
||||
Neighbor * neighbor;
|
||||
bool skipLoggingError = false;
|
||||
|
||||
otLogDebgMle("Receive UDP message");
|
||||
|
||||
@@ -2828,7 +2829,15 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
|
||||
aesCcm.Finalize(tag);
|
||||
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
VerifyOrExit(memcmp(messageTag, tag, sizeof(tag)) == 0, error = kErrorSecurity);
|
||||
if (memcmp(messageTag, tag, sizeof(tag)) != 0)
|
||||
{
|
||||
// We skip logging security check failures for broadcast MLE
|
||||
// messages since it can be common to receive such messages
|
||||
// from adjacent Thread networks.
|
||||
skipLoggingError = (aMessageInfo.GetSockAddr().IsMulticast() &&
|
||||
aMessageInfo.GetThreadLinkInfo()->GetPanId() == Mac::kPanIdBroadcast);
|
||||
ExitNow(error = kErrorSecurity);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (keySequence > Get<KeyManager>().GetCurrentKeySequence())
|
||||
@@ -3017,7 +3026,10 @@ void Mle::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageIn
|
||||
#endif
|
||||
|
||||
exit:
|
||||
LogProcessError(kTypeGenericUdp, error);
|
||||
if (!skipLoggingError)
|
||||
{
|
||||
LogProcessError(kTypeGenericUdp, error);
|
||||
}
|
||||
}
|
||||
|
||||
void Mle::HandleAdvertisement(const Message &aMessage, const Ip6::MessageInfo &aMessageInfo, Neighbor *aNeighbor)
|
||||
|
||||
Reference in New Issue
Block a user