[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:
Krzysztof Bogucki
2019-02-13 08:59:33 -08:00
committed by Jonathan Hui
parent 14d4d88727
commit 96de36385a
3 changed files with 20 additions and 4 deletions
+5 -4
View File
@@ -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)
{
+6
View File
@@ -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);
+9
View File
@@ -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),
*