diff --git a/Android.mk b/Android.mk index b70ee66f2..533db375a 100644 --- a/Android.mk +++ b/Android.mk @@ -278,6 +278,7 @@ LOCAL_SRC_FILES := \ src/core/net/ip6_filter.cpp \ src/core/net/ip6_headers.cpp \ src/core/net/ip6_mpl.cpp \ + src/core/net/nd_agent.cpp \ src/core/net/netif.cpp \ src/core/net/sntp_client.cpp \ src/core/net/socket.cpp \ diff --git a/etc/cmake/options.cmake b/etc/cmake/options.cmake index f4cb89764..9cb8b2eeb 100644 --- a/etc/cmake/options.cmake +++ b/etc/cmake/options.cmake @@ -257,6 +257,11 @@ if(OT_MULTIPLE_INSTANCE) target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE=1") endif() +option(OT_NEIGHBOR_DISCOVERY_AGENT "enable neighbor discovery agent support") +if(OT_NEIGHBOR_DISCOVERY_AGENT) + target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE=1") +endif() + option(OT_PING_SENDER "enable ping sender support" ${OT_APP_CLI}) if(OT_PING_SENDER) target_compile_definitions(ot-config INTERFACE "OPENTHREAD_CONFIG_PING_SENDER_ENABLE=1") diff --git a/examples/Makefile-simulation b/examples/Makefile-simulation index d1d4a1189..afa89110f 100644 --- a/examples/Makefile-simulation +++ b/examples/Makefile-simulation @@ -59,6 +59,7 @@ LEGACY ?= 1 LINK_RAW ?= 1 MAC_FILTER ?= 1 MTD_NETDIAG ?= 1 +NEIGHBOR_DISCOVERY_AGENT ?= 1 PING_SENDER ?= 1 REFERENCE_DEVICE ?= 1 SERVICE ?= 1 diff --git a/examples/common-switches.mk b/examples/common-switches.mk index 7768f660f..3c7a181b9 100644 --- a/examples/common-switches.mk +++ b/examples/common-switches.mk @@ -69,6 +69,7 @@ MLE_LONG_ROUTES ?= 0 MLR ?= 0 MTD_NETDIAG ?= 0 MULTIPLE_INSTANCE ?= 0 +NEIGHBOR_DISCOVERY_AGENT ?= 0 OTNS ?= 0 PING_SENDER ?= 1 PLATFORM_UDP ?= 0 @@ -256,6 +257,10 @@ ifeq ($(MULTIPLE_INSTANCE),1) COMMONCFLAGS += -DOPENTHREAD_CONFIG_MULTIPLE_INSTANCE_ENABLE=1 endif +ifeq ($(NEIGHBOR_DISCOVERY_AGENT),1) +COMMONCFLAGS += -DOPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE=1 +endif + ifeq ($(PING_SENDER),1) COMMONCFLAGS += -DOPENTHREAD_CONFIG_PING_SENDER_ENABLE=1 endif diff --git a/script/check-scan-build b/script/check-scan-build index c30889a97..0c4bc1263 100755 --- a/script/check-scan-build +++ b/script/check-scan-build @@ -68,6 +68,7 @@ do_scan_build() "-DOPENTHREAD_CONFIG_MLE_ATTACH_BACKOFF_ENABLE=1" "-DOPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE=1" "-DOPENTHREAD_CONFIG_MPL_DYNAMIC_INTERVAL_ENABLE" + "-DOPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT=1" "-DOPENTHREAD_CONFIG_PING_SENDER_ENABLE=1" "-DOPENTHREAD_CONFIG_PLATFORM_FLASH_API_ENABLE=1" "-DOPENTHREAD_CONFIG_PLATFORM_RADIO_COEX_ENABLE=1" diff --git a/script/cmake-build b/script/cmake-build index 813304e84..91747a21d 100755 --- a/script/cmake-build +++ b/script/cmake-build @@ -104,6 +104,7 @@ readonly OT_POSIX_SIM_COMMON_OPTIONS=( "-DOT_LEGACY=ON" "-DOT_MAC_FILTER=ON" "-DOT_MTD_NETDIAG=ON" + "-DOT_NEIGHBOR_DISCOVERY_AGENT=ON" "-DOT_PING_SENDER=ON" "-DOT_REFERENCE_DEVICE=ON" "-DOT_SERVICE=ON" diff --git a/src/core/BUILD.gn b/src/core/BUILD.gn index 45346e097..c82c247e5 100644 --- a/src/core/BUILD.gn +++ b/src/core/BUILD.gn @@ -506,6 +506,8 @@ openthread_core_files = [ "net/ip6_headers.hpp", "net/ip6_mpl.cpp", "net/ip6_mpl.hpp", + "net/nd_agent.cpp", + "net/nd_agent.hpp", "net/netif.cpp", "net/netif.hpp", "net/sntp_client.cpp", diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 308f50de4..61e166df0 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -153,6 +153,7 @@ set(COMMON_SOURCES net/ip6_filter.cpp net/ip6_headers.cpp net/ip6_mpl.cpp + net/nd_agent.cpp net/netif.cpp net/sntp_client.cpp net/socket.cpp diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 97924a99a..b229619f0 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -230,6 +230,7 @@ SOURCES_COMMON = \ net/ip6_filter.cpp \ net/ip6_headers.cpp \ net/ip6_mpl.cpp \ + net/nd_agent.cpp \ net/netif.cpp \ net/sntp_client.cpp \ net/socket.cpp \ @@ -486,6 +487,7 @@ HEADERS_COMMON = \ net/ip6_filter.hpp \ net/ip6_headers.hpp \ net/ip6_mpl.hpp \ + net/nd_agent.hpp \ net/netif.hpp \ net/sntp_client.hpp \ net/socket.hpp \ diff --git a/src/core/common/instance.hpp b/src/core/common/instance.hpp index d87f68b16..57621473e 100644 --- a/src/core/common/instance.hpp +++ b/src/core/common/instance.hpp @@ -752,6 +752,13 @@ template <> inline Dhcp6::Server &Instance::Get(void) } #endif +#if OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE +template <> inline NeighborDiscovery::Agent &Instance::Get(void) +{ + return mThreadNetif.mNeighborDiscoveryAgent; +} +#endif + #if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE template <> inline Utils::Slaac &Instance::Get(void) { diff --git a/src/core/config/openthread-core-default-config.h b/src/core/config/openthread-core-default-config.h index 5697d72c8..55160304a 100644 --- a/src/core/config/openthread-core-default-config.h +++ b/src/core/config/openthread-core-default-config.h @@ -493,4 +493,14 @@ #define OPENTHREAD_CONFIG_MLR_ENABLE 0 #endif +/** + * @def OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE + * + * Define as 1 to enable support for Neighbor Discover Agent. + * + */ +#ifndef OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE +#define OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE 0 +#endif + #endif // OPENTHREAD_CORE_DEFAULT_CONFIG_H_ diff --git a/src/core/net/nd_agent.cpp b/src/core/net/nd_agent.cpp new file mode 100644 index 000000000..490827966 --- /dev/null +++ b/src/core/net/nd_agent.cpp @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2021, The OpenThread Authors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file + * This file implements IPv6 Neighbor Discovery Agent. + */ + +#include "nd_agent.hpp" + +#if OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE + +#include "common/locator_getters.hpp" +#include "thread/lowpan.hpp" +#include "thread/mle_router.hpp" +#include "thread/network_data_leader.hpp" +#include "thread/thread_netif.hpp" + +namespace ot { +namespace NeighborDiscovery { + +void Agent::UpdateService(void) +{ + Error error; + uint16_t rloc16 = Get().GetRloc16(); + NetworkData::Iterator iterator; + NetworkData::OnMeshPrefixConfig config; + Lowpan::Context lowpanContext; + + if (IsAlocInUse()) + { + uint8_t contextId = static_cast(mAloc.GetAddress().GetIid().GetLocator() - + Mle::kAloc16NeighborDiscoveryAgentStart + 1); + bool found = false; + + iterator = NetworkData::kIteratorInit; + + while (Get().GetNextOnMeshPrefix(iterator, rloc16, config) == kErrorNone) + { + if (!config.mNdDns) + { + continue; + } + + error = Get().GetContext(static_cast(config.mPrefix.mPrefix), + lowpanContext); + + if ((error != kErrorNone) || (lowpanContext.mContextId != contextId)) + { + continue; + } + + found = true; + break; + } + + if (!found) + { + Get().RemoveUnicastAddress(mAloc); + FreeAloc(); + } + } + + VerifyOrExit(!IsAlocInUse()); + + iterator = NetworkData::kIteratorInit; + + while (Get().GetNextOnMeshPrefix(iterator, rloc16, config) == kErrorNone) + { + if (!config.mNdDns) + { + continue; + } + + error = Get().GetContext(static_cast(config.mPrefix.mPrefix), + lowpanContext); + + if (error == kErrorNone) + { + uint16_t rloc = Mle::kAloc16NeighborDiscoveryAgentStart + lowpanContext.mContextId - 1; + + mAloc.InitAsThreadOrigin(); + mAloc.GetAddress().SetToAnycastLocator(Get().GetMeshLocalPrefix(), rloc); + Get().AddUnicastAddress(mAloc); + ExitNow(); + } + } + +exit: + return; +} + +void Agent::ApplyMeshLocalPrefix(void) +{ + VerifyOrExit(IsAlocInUse()); + + Get().RemoveUnicastAddress(mAloc); + mAloc.GetAddress().SetPrefix(Get().GetMeshLocalPrefix()); + Get().AddUnicastAddress(mAloc); + +exit: + return; +} + +} // namespace NeighborDiscovery +} // namespace ot + +#endif // OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE diff --git a/src/core/net/nd_agent.hpp b/src/core/net/nd_agent.hpp new file mode 100644 index 000000000..7646693cb --- /dev/null +++ b/src/core/net/nd_agent.hpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2021, The OpenThread Authors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the copyright holder nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +/** + * @file + * This file includes definitions for IPv6 Neighbor Discovery Agent. + */ + +#ifndef NEIGHBOR_DISCOVERY_AGENT_HPP_ +#define NEIGHBOR_DISCOVERY_AGENT_HPP_ + +#include "openthread-core-config.h" + +#if OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE + +#include "common/locator.hpp" +#include "common/non_copyable.hpp" +#include "net/netif.hpp" + +namespace ot { +namespace NeighborDiscovery { + +class Agent : public InstanceLocator, private NonCopyable +{ +public: + /** + * This constructor initializes the object. + * + * @param[in] aInstance A reference to the OpenThread instance. + * + */ + explicit Agent(Instance &aInstance) + : InstanceLocator(aInstance) + { + FreeAloc(); + } + + /** + * This method updates the Neighbor Discovery Agents using current Thread Network Data. + * + */ + void UpdateService(void); + + /** + * This method updates the prefix of the Neighbor Discovery Agent Anycast Locator. + * + */ + void ApplyMeshLocalPrefix(void); + +private: + void FreeAloc(void) { mAloc.mNext = &mAloc; } + bool IsAlocInUse(void) const { return mAloc.mNext != &mAloc; } + + Ip6::NetifUnicastAddress mAloc; +}; + +} // namespace NeighborDiscovery +} // namespace ot + +#endif // OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE + +#endif // NEIGHBOR_DISCOVERY_AGENT_HPP_ diff --git a/src/core/thread/mesh_forwarder.hpp b/src/core/thread/mesh_forwarder.hpp index e205a88c2..19a6e690f 100644 --- a/src/core/thread/mesh_forwarder.hpp +++ b/src/core/thread/mesh_forwarder.hpp @@ -339,6 +339,12 @@ private: kMessageEvict, ///< Indicates that the message was evicted. }; + enum AnycastType : uint8_t + { + kAnycastDhcp6Agent, + kAnycastNeighborDiscoveryAgent, + }; + #if OPENTHREAD_FTD class FragmentPriorityList : public Clearable { @@ -440,7 +446,7 @@ private: void SendDestinationUnreachable(uint16_t aMeshSource, const Message &aMessage); Error UpdateIp6Route(Message &aMessage); Error UpdateIp6RouteFtd(Ip6::Header &ip6Header, Message &aMessage); - Error ContextIdRouteLookup(uint8_t aContextId, uint16_t &aMeshDest) const; + Error ContextIdRouteLookup(uint8_t aContextId, AnycastType aType, uint16_t &aMeshDest) const; Error UpdateMeshRoute(Message &aMessage); bool UpdateReassemblyList(void); void UpdateFragmentPriority(Lowpan::FragmentHeader &aFragmentHeader, diff --git a/src/core/thread/mesh_forwarder_ftd.cpp b/src/core/thread/mesh_forwarder_ftd.cpp index 5ef3af6fa..37775d6de 100644 --- a/src/core/thread/mesh_forwarder_ftd.cpp +++ b/src/core/thread/mesh_forwarder_ftd.cpp @@ -402,7 +402,7 @@ exit: return error; } -Error MeshForwarder::ContextIdRouteLookup(uint8_t aContextId, uint16_t &aMeshDest) const +Error MeshForwarder::ContextIdRouteLookup(uint8_t aContextId, AnycastType aType, uint16_t &aMeshDest) const { Lowpan::Context context; NetworkData::Iterator iterator = NetworkData::kIteratorInit; @@ -424,6 +424,22 @@ Error MeshForwarder::ContextIdRouteLookup(uint8_t aContextId, uint16_t &aMeshDes continue; } + switch (aType) + { + case kAnycastDhcp6Agent: + if (!(config.mDhcp || config.mConfigure)) + { + continue; + } + break; + case kAnycastNeighborDiscoveryAgent: + if (!config.mNdDns) + { + continue; + } + break; + } + // Path cost curCost = Get().GetCost(server16); @@ -507,8 +523,8 @@ Error MeshForwarder::UpdateIp6RouteFtd(Ip6::Header &ip6Header, Message &aMessage } else if (aloc16 <= Mle::kAloc16DhcpAgentEnd) { - uint8_t contextId = static_cast(aloc16 & Mle::kAloc16DhcpAgentMask); - SuccessOrExit(error = ContextIdRouteLookup(contextId, mMeshDest)); + uint8_t contextId = static_cast(aloc16 - Mle::kAloc16DhcpAgentStart + 1); + SuccessOrExit(error = ContextIdRouteLookup(contextId, kAnycastDhcp6Agent, mMeshDest)); } else if (aloc16 <= Mle::kAloc16ServiceEnd) { @@ -526,9 +542,14 @@ Error MeshForwarder::UpdateIp6RouteFtd(Ip6::Header &ip6Header, Message &aMessage mMeshDest = Get().GetServer16(); } #endif + else if ((aloc16 >= Mle::kAloc16NeighborDiscoveryAgentStart) && + (aloc16 <= Mle::kAloc16NeighborDiscoveryAgentEnd)) + { + uint8_t contextId = static_cast(aloc16 - Mle::kAloc16NeighborDiscoveryAgentStart + 1); + SuccessOrExit(error = ContextIdRouteLookup(contextId, kAnycastNeighborDiscoveryAgent, mMeshDest)); + } else { - // TODO: support for Neighbor Discovery Agent ALOC ExitNow(error = kErrorDrop); } } diff --git a/src/core/thread/mle.cpp b/src/core/thread/mle.cpp index 4967c4208..1b6e6d47d 100644 --- a/src/core/thread/mle.cpp +++ b/src/core/thread/mle.cpp @@ -858,6 +858,10 @@ void Mle::ApplyMeshLocalPrefix(void) Get().ApplyMeshLocalPrefix(); #endif +#if OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE + Get().ApplyMeshLocalPrefix(); +#endif + #if OPENTHREAD_CONFIG_TMF_NETDATA_SERVICE_ENABLE for (Ip6::NetifUnicastAddress &serviceAloc : mServiceAlocs) @@ -1556,11 +1560,15 @@ void Mle::HandleNotifierEvents(Events aEvents) #if OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE IgnoreError(Get().UpdateService()); -#endif // OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#endif + +#if OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE + Get().UpdateService(); +#endif #if OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE Get().UpdateAddresses(); -#endif // OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#endif } if (aEvents.ContainsAny(kEventThreadRoleChanged | kEventThreadKeySeqCounterChanged)) diff --git a/src/core/thread/mle_types.hpp b/src/core/thread/mle_types.hpp index b210fa685..d887b2a86 100644 --- a/src/core/thread/mle_types.hpp +++ b/src/core/thread/mle_types.hpp @@ -235,7 +235,6 @@ enum AlocAllocation kAloc16Leader = 0xfc00, kAloc16DhcpAgentStart = 0xfc01, kAloc16DhcpAgentEnd = 0xfc0f, - kAloc16DhcpAgentMask = 0x000f, kAloc16ServiceStart = 0xfc10, kAloc16ServiceEnd = 0xfc2f, kAloc16CommissionerStart = 0xfc30, diff --git a/src/core/thread/thread_netif.cpp b/src/core/thread/thread_netif.cpp index aa00e677d..6ebfcfc7b 100644 --- a/src/core/thread/thread_netif.cpp +++ b/src/core/thread/thread_netif.cpp @@ -56,6 +56,9 @@ ThreadNetif::ThreadNetif(Instance &aInstance) #if OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE , mDhcp6Server(aInstance) #endif +#if OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE + , mNeighborDiscoveryAgent(aInstance) +#endif #if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE , mSlaac(aInstance) #endif diff --git a/src/core/thread/thread_netif.hpp b/src/core/thread/thread_netif.hpp index 5d92c404b..59ce9cd5e 100644 --- a/src/core/thread/thread_netif.hpp +++ b/src/core/thread/thread_netif.hpp @@ -82,6 +82,7 @@ #include "net/dns_client.hpp" #include "net/dnssd_server.hpp" #include "net/ip6_filter.hpp" +#include "net/nd_agent.hpp" #include "net/netif.hpp" #include "net/sntp_client.hpp" #include "net/srp_client.hpp" @@ -195,10 +196,13 @@ private: Tmf::TmfAgent mTmfAgent; #if OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE Dhcp6::Client mDhcp6Client; -#endif // OPENTHREAD_CONFIG_DHCP6_CLIENT_ENABLE +#endif #if OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE Dhcp6::Server mDhcp6Server; -#endif // OPENTHREAD_CONFIG_DHCP6_SERVER_ENABLE +#endif +#if OPENTHREAD_CONFIG_NEIGHBOR_DISCOVERY_AGENT_ENABLE + NeighborDiscovery::Agent mNeighborDiscoveryAgent; +#endif #if OPENTHREAD_CONFIG_IP6_SLAAC_ENABLE Utils::Slaac mSlaac; #endif diff --git a/src/posix/Makefile-posix b/src/posix/Makefile-posix index b4c97832f..2f0621250 100644 --- a/src/posix/Makefile-posix +++ b/src/posix/Makefile-posix @@ -62,6 +62,7 @@ LOG_OUTPUT ?= PLATFORM_DEFINED MAC_FILTER ?= 1 MAX_POWER_TABLE ?= 1 MTD_NETDIAG ?= 1 +NEIGHBOR_DISCOVERY_AGENT ?= 1 PING_SENDER ?= 1 READLINE ?= readline REFERENCE_DEVICE ?= 1 diff --git a/tests/scripts/thread-cert/test_anycast.py b/tests/scripts/thread-cert/test_anycast.py index a3400131e..41c100073 100755 --- a/tests/scripts/thread-cert/test_anycast.py +++ b/tests/scripts/thread-cert/test_anycast.py @@ -93,6 +93,7 @@ class TestAnycast(thread_cert.TestCase): self.__test('ds') # DHCPv6 Agent (IPv6 Address) self.__test('cs') # DHCPv6 Agent (Other) + self.__test('ns') # Neighbor Discovery Agent def __test(self, borderRouterFlags): # Single Server