mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 21:57:47 +00:00
[ip6] messages sent to Service Locator will not be filtered out (#3585)
Messages sent to Service Locator will not be filtered out, when thread control traffic filtering is enabled via SetReceiveIp6FilterEnabled().
This commit is contained in:
committed by
Jonathan Hui
parent
14d4d88727
commit
96de36385a
@@ -701,10 +701,11 @@ otError Ip6::ProcessReceiveCallback(const Message & aMessage,
|
||||
|
||||
if (mIsReceiveIp6FilterEnabled)
|
||||
{
|
||||
// do not pass messages sent to an RLOC/ALOC
|
||||
VerifyOrExit(!aMessageInfo.GetSockAddr().IsRoutingLocator() &&
|
||||
!aMessageInfo.GetSockAddr().IsAnycastRoutingLocator(),
|
||||
error = OT_ERROR_NO_ROUTE);
|
||||
// do not pass messages sent to an RLOC/ALOC, except Service Locator
|
||||
VerifyOrExit(
|
||||
(!aMessageInfo.GetSockAddr().IsRoutingLocator() && !aMessageInfo.GetSockAddr().IsAnycastRoutingLocator()) ||
|
||||
aMessageInfo.GetSockAddr().IsAnycastServiceLocator(),
|
||||
error = OT_ERROR_NO_ROUTE);
|
||||
|
||||
switch (aIpProto)
|
||||
{
|
||||
|
||||
@@ -130,6 +130,12 @@ bool Address::IsAnycastRoutingLocator(void) const
|
||||
mFields.m16[6] == HostSwap16(0xfe00) && mFields.m8[14] == kAloc16Mask);
|
||||
}
|
||||
|
||||
bool Address::IsAnycastServiceLocator(void) const
|
||||
{
|
||||
return IsAnycastRoutingLocator() && (mFields.m16[7] >= HostSwap16(Mle::kAloc16ServiceStart)) &&
|
||||
(mFields.m16[7] <= HostSwap16(Mle::kAloc16ServiceEnd));
|
||||
}
|
||||
|
||||
bool Address::IsSubnetRouterAnycast(void) const
|
||||
{
|
||||
return (mFields.m32[2] == 0 && mFields.m32[3] == 0);
|
||||
|
||||
@@ -243,6 +243,15 @@ public:
|
||||
*/
|
||||
bool IsAnycastRoutingLocator(void) const;
|
||||
|
||||
/**
|
||||
* This method indicates whether or not the IPv6 address is an Anycast Service Locator.
|
||||
*
|
||||
* @retval TRUE If the IPv6 address is an Anycast Service Locator.
|
||||
* @retval FALSE If the IPv6 address is not an Anycast Service Locator.
|
||||
*
|
||||
*/
|
||||
bool IsAnycastServiceLocator(void) const;
|
||||
|
||||
/**
|
||||
* This method indicates whether or not the IPv6 address is Subnet-Router Anycast (RFC 4291),
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user