diff --git a/src/core/thread/mesh_forwarder_ftd.cpp b/src/core/thread/mesh_forwarder_ftd.cpp index 12accafa4..4001bbeb5 100644 --- a/src/core/thread/mesh_forwarder_ftd.cpp +++ b/src/core/thread/mesh_forwarder_ftd.cpp @@ -511,7 +511,7 @@ Error MeshForwarder::UpdateIp6RouteFtd(const Ip6::Header &aIp6Header, Message &a else if (mle.IsRoutingLocator(aIp6Header.GetDestination())) { uint16_t rloc16 = aIp6Header.GetDestination().GetIid().GetLocator(); - VerifyOrExit(mle.IsRouterIdValid(Mle::RouterIdFromRloc16(rloc16)), error = kErrorDrop); + VerifyOrExit(Mle::IsRouterIdValid(Mle::RouterIdFromRloc16(rloc16)), error = kErrorDrop); mMeshDest = rloc16; } else if (mle.IsAnycastLocator(aIp6Header.GetDestination())) diff --git a/src/core/thread/mle_router.hpp b/src/core/thread/mle_router.hpp index fd876044a..048d901d9 100644 --- a/src/core/thread/mle_router.hpp +++ b/src/core/thread/mle_router.hpp @@ -421,17 +421,6 @@ class MleRouter : public Mle */ void ResolveRoutingLoops(uint16_t aSourceMac, uint16_t aDestRloc16); - /** - * Checks if a given Router ID has correct value. - * - * @param[in] aRouterId The Router ID value. - * - * @retval TRUE If @p aRouterId is in correct range [0..62]. - * @retval FALSE If @p aRouterId is not a valid Router ID. - * - */ - static bool IsRouterIdValid(uint8_t aRouterId) { return aRouterId <= kMaxRouterId; } - /** * Fills an ConnectivityTlv. * @@ -799,8 +788,6 @@ class MleRouter : public Mle Error RemoveNeighbor(Neighbor &) { return BecomeDetached(); } void RemoveRouterLink(Router &) { IgnoreError(BecomeDetached()); } - static bool IsRouterIdValid(uint8_t aRouterId) { return aRouterId <= kMaxRouterId; } - Error SendChildUpdateRequest(void) { return Mle::SendChildUpdateRequest(); } Error CheckReachability(uint16_t aMeshDest, const Ip6::Header &aIp6Header) diff --git a/src/core/thread/mle_types.hpp b/src/core/thread/mle_types.hpp index ae4dfdfa3..ab2a7b02d 100644 --- a/src/core/thread/mle_types.hpp +++ b/src/core/thread/mle_types.hpp @@ -616,6 +616,17 @@ inline uint16_t ChildIdFromRloc16(uint16_t aRloc16) { return aRloc16 & kMaxChild */ inline uint8_t RouterIdFromRloc16(uint16_t aRloc16) { return aRloc16 >> kRouterIdOffset; } +/** + * Indicates whether or not a given Router ID is valid. + * + * @param[in] aRouterId The Router ID value to check. + * + * @retval TRUE If @p aRouterId is in correct range [0..62]. + * @retval FALSE If @p aRouterId is not a valid Router ID. + * + */ +inline bool IsRouterIdValid(uint8_t aRouterId) { return aRouterId <= kMaxRouterId; } + /** * Returns whether the two RLOC16 have the same Router ID. *