mirror of
https://github.com/espressif/openthread.git
synced 2026-09-12 20:20:04 +00:00
[ip6-address] simplify IsAnycastServiceLocator() (#4519)
This change ensures we avoid comparing values with host-swapped constants.
This commit is contained in:
committed by
Jonathan Hui
parent
16b6c8df89
commit
0f274641f1
@@ -129,8 +129,8 @@ bool Address::IsAnycastRoutingLocator(void) const
|
||||
|
||||
bool Address::IsAnycastServiceLocator(void) const
|
||||
{
|
||||
return IsAnycastRoutingLocator() && (mFields.m16[7] >= HostSwap16(Mle::kAloc16ServiceStart)) &&
|
||||
(mFields.m16[7] <= HostSwap16(Mle::kAloc16ServiceEnd));
|
||||
return IsAnycastRoutingLocator() && (mFields.m8[15] >= (Mle::kAloc16ServiceStart & 0xff)) &&
|
||||
(mFields.m8[15] <= (Mle::kAloc16ServiceEnd & 0xff));
|
||||
}
|
||||
|
||||
bool Address::IsSubnetRouterAnycast(void) const
|
||||
|
||||
Reference in New Issue
Block a user