diff --git a/src/core/net/ip6.cpp b/src/core/net/ip6.cpp index e5140a839..adc4fd374 100644 --- a/src/core/net/ip6.cpp +++ b/src/core/net/ip6.cpp @@ -67,7 +67,6 @@ RegisterLogModule("Ip6"); Ip6::Ip6(Instance &aInstance) : InstanceLocator(aInstance) - , mForwardingEnabled(false) , mIsReceiveIp6FilterEnabled(false) , mSendQueueTask(aInstance) , mIcmp(aInstance) @@ -1299,7 +1298,7 @@ start: if (aOrigin == kFromThreadNetif) { - VerifyOrExit(mForwardingEnabled); + VerifyOrExit(Get().IsRouterOrLeader()); header.SetHopLimit(header.GetHopLimit() - 1); } diff --git a/src/core/net/ip6.hpp b/src/core/net/ip6.hpp index 0ae284c9e..670d047a2 100644 --- a/src/core/net/ip6.hpp +++ b/src/core/net/ip6.hpp @@ -293,22 +293,6 @@ public: */ void SetReceiveIp6FilterEnabled(bool aEnabled) { mIsReceiveIp6FilterEnabled = aEnabled; } - /** - * This method indicates whether or not IPv6 forwarding is enabled. - * - * @returns TRUE if IPv6 forwarding is enabled, FALSE otherwise. - * - */ - bool IsForwardingEnabled(void) const { return mForwardingEnabled; } - - /** - * This method enables/disables IPv6 forwarding. - * - * @param[in] aEnable TRUE to enable IPv6 forwarding, FALSE otherwise. - * - */ - void SetForwardingEnabled(bool aEnable) { mForwardingEnabled = aEnable; } - /** * This method performs default source address selection. * @@ -432,7 +416,6 @@ private: using SendQueueTask = TaskletIn; - bool mForwardingEnabled; bool mIsReceiveIp6FilterEnabled; Callback mReceiveIp6DatagramCallback; diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index c840a517f..a47104d7f 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -697,7 +697,6 @@ void Mle::SetStateDetached(void) #if OPENTHREAD_FTD Get().HandleDetachStart(); #endif - Get().SetForwardingEnabled(false); #if OPENTHREAD_CONFIG_MAC_CSL_RECEIVER_ENABLE Get().UpdateCsl(); #endif @@ -727,8 +726,6 @@ void Mle::SetStateChild(uint16_t aRloc16) } #endif - Get().SetForwardingEnabled(false); - // send announce after attached if needed InformPreviousChannel(); diff --git a/src/core/thread/mle_router.cpp b/src/core/thread/mle_router.cpp index 8545a69ef..3ea8832cc 100644 --- a/src/core/thread/mle_router.cpp +++ b/src/core/thread/mle_router.cpp @@ -378,7 +378,6 @@ void MleRouter::SetStateRouter(uint16_t aRloc16) Get().SubscribeAllRoutersMulticast(); mPreviousPartitionIdRouter = mLeaderData.GetPartitionId(); - Get().SetForwardingEnabled(true); Get().SetBeaconEnabled(true); // remove children that do not have matching RLOC16 @@ -418,7 +417,6 @@ void MleRouter::SetStateLeader(uint16_t aRloc16, LeaderStartMode aStartMode) Get().Start(aStartMode); Get().StartLeader(); Get().StartLeader(); - Get().SetForwardingEnabled(true); Get().SetBeaconEnabled(true); Get().Clear();