mirror of
https://github.com/espressif/openthread.git
synced 2025-05-17 07:16:08 +08:00
[udp] relax SocketHandle::Matches()
for host interface (#11465)
This commit relaxes the `SocketHandle::Matches()` method to allow a socket associated with `kNetifUnspecified` to match when `IsHostInterface()` is set. This is in addition to the existing behavior of matching a backbone socket under the same condition.
This commit is contained in:

committed by
GitHub

parent
bf2e2417ed
commit
262551ff64
@ -46,7 +46,14 @@ bool Udp::SocketHandle::Matches(const MessageInfo &aMessageInfo) const
|
||||
bool matches = false;
|
||||
|
||||
#if OPENTHREAD_FTD && OPENTHREAD_CONFIG_BACKBONE_ROUTER_ENABLE
|
||||
VerifyOrExit(IsBackbone() == aMessageInfo.IsHostInterface());
|
||||
if (aMessageInfo.IsHostInterface())
|
||||
{
|
||||
VerifyOrExit(IsBackbone() || (GetNetifId() == kNetifUnspecified));
|
||||
}
|
||||
else
|
||||
{
|
||||
VerifyOrExit(!IsBackbone());
|
||||
}
|
||||
#endif
|
||||
|
||||
VerifyOrExit(GetSockName().mPort == aMessageInfo.GetSockPort());
|
||||
|
Reference in New Issue
Block a user