[ip6] filter received packets with loopback addrs (#10998)

This commit is contained in:
Jonathan Hui
2024-12-05 12:41:12 -08:00
committed by GitHub
parent ee2d7d5a3e
commit 881f557629
+5
View File
@@ -1086,6 +1086,11 @@ Error Ip6::HandleDatagram(OwnedPtr<Message> aMessagePtr, bool aIsReassembled)
SuccessOrExit(error = header.ParseFrom(*aMessagePtr));
if (!aMessagePtr->IsOriginHostTrusted())
{
VerifyOrExit(!header.GetSource().IsLoopback() && !header.GetDestination().IsLoopback(), error = kErrorDrop);
}
// Determine `forwardThread`, `forwardHost` and `receive`
// based on the destination address.