Skip to content

Commit

Permalink
[ip6] filter received packets with loopback addrs (#10998)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhui authored Dec 5, 2024
1 parent ee2d7d5 commit 881f557
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/net/ip6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 881f557

Please sign in to comment.