diff --git a/src/core/net/ip6.hpp b/src/core/net/ip6.hpp index d06270965..3982b6189 100644 --- a/src/core/net/ip6.hpp +++ b/src/core/net/ip6.hpp @@ -293,6 +293,13 @@ public: */ static const char *EcnToString(Ecn aEcn); + /** + * Indicates whether the address is on the thread link or not. + * + * @returns TRUE if the address is on the thread link, FALSE otherwise. + */ + bool IsOnLink(const Address &aAddress) const; + #if OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE typedef otBorderRoutingCounters BrCounters; ///< Border Routing counters. @@ -376,7 +383,6 @@ private: OwnedPtr &aMessagePtr, uint8_t aIpProto, Message::Ownership aMessageOwnership); - bool IsOnLink(const Address &aAddress) const; Error RouteLookup(const Address &aSource, const Address &aDestination) const; #if OPENTHREAD_CONFIG_IP6_BR_COUNTERS_ENABLE void UpdateBorderRoutingCounters(const Header &aHeader, uint16_t aMessageLength, bool aIsInbound); diff --git a/src/core/thread/mesh_forwarder_ftd.cpp b/src/core/thread/mesh_forwarder_ftd.cpp index 04f1feda0..841614a27 100644 --- a/src/core/thread/mesh_forwarder_ftd.cpp +++ b/src/core/thread/mesh_forwarder_ftd.cpp @@ -433,7 +433,7 @@ Error MeshForwarder::UpdateIp6RouteFtd(const Ip6::Header &aIp6Header, Message &a { mMeshDest = neighbor->GetRloc16(); } - else if (Get().IsOnMesh(aIp6Header.GetDestination())) + else if (Get().IsOnLink(aIp6Header.GetDestination())) { SuccessOrExit(error = Get().Resolve(aIp6Header.GetDestination(), mMeshDest)); }