From 1850152029b924ded234d1e920bd12457aef328e Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Thu, 19 Mar 2020 16:33:57 -0700 Subject: [PATCH] [ip6] remove IPv6 multicast forwarding to sleepys from MTD build (#4730) --- src/core/net/ip6.cpp | 6 ++++++ src/core/thread/mle_router_mtd.hpp | 2 -- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/net/ip6.cpp b/src/core/net/ip6.cpp index 11c0ead26..83d3a3d4b 100644 --- a/src/core/net/ip6.cpp +++ b/src/core/net/ip6.cpp @@ -305,6 +305,7 @@ otError Ip6::InsertMplOption(Message &aMessage, Header &aHeader, MessageInfo &aM } else { +#if OPENTHREAD_FTD if (aHeader.GetDestination().IsMulticastLargerThanRealmLocal() && Get().HasSleepyChildrenSubscribed(aHeader.GetDestination())) { @@ -320,6 +321,7 @@ otError Ip6::InsertMplOption(Message &aMessage, Header &aHeader, MessageInfo &aM otLogWarnIp6("No enough buffer for message copy for indirect transmission to sleepy children"); } } +#endif SuccessOrExit(error = AddTunneledMplOption(aMessage, aHeader, aMessageInfo)); } @@ -510,6 +512,7 @@ otError Ip6::SendDatagram(Message &aMessage, MessageInfo &aMessageInfo, uint8_t if (aMessageInfo.GetPeerAddr().IsMulticastLargerThanRealmLocal()) { +#if OPENTHREAD_FTD if (Get().HasSleepyChildrenSubscribed(header.GetDestination())) { Message *messageCopy = NULL; @@ -524,6 +527,7 @@ otError Ip6::SendDatagram(Message &aMessage, MessageInfo &aMessageInfo, uint8_t otLogWarnIp6("No enough buffer for message copy for indirect transmission to sleepy children"); } } +#endif SuccessOrExit(error = AddTunneledMplOption(aMessage, header, aMessageInfo)); } @@ -1178,11 +1182,13 @@ otError Ip6::HandleDatagram(Message &aMessage, Netif *aNetif, const void *aLinkM multicastPromiscuous = true; } +#if OPENTHREAD_FTD if (header.GetDestination().IsMulticastLargerThanRealmLocal() && Get().HasSleepyChildrenSubscribed(header.GetDestination())) { forward = true; } +#endif } else { diff --git a/src/core/thread/mle_router_mtd.hpp b/src/core/thread/mle_router_mtd.hpp index 6837e4154..95831bf64 100644 --- a/src/core/thread/mle_router_mtd.hpp +++ b/src/core/thread/mle_router_mtd.hpp @@ -77,8 +77,6 @@ public: otError SendChildUpdateRequest(void) { return Mle::SendChildUpdateRequest(); } otError GetMaxChildTimeout(uint32_t &) { return OT_ERROR_NOT_IMPLEMENTED; } - - bool HasSleepyChildrenSubscribed(const Ip6::Address &) { return false; } }; } // namespace Mle