diff --git a/sys/include/net/gnrc/ipv6/nib/conf.h b/sys/include/net/gnrc/ipv6/nib/conf.h index d859428782461a03b56fcf97c40ac8fd96f81b14..b26c0e68dc9b26377c0b4bff580a6a3bc85b15d5 100644 --- a/sys/include/net/gnrc/ipv6/nib/conf.h +++ b/sys/include/net/gnrc/ipv6/nib/conf.h @@ -216,6 +216,15 @@ extern "C" { #define GNRC_IPV6_NIB_CONF_REACH_TIME_RESET (7200000U) #endif +/** + * @brief Disable router solicitations + * + * @warning Only do this if you know what you're doing + */ +#ifndef GNRC_IPV6_NIB_CONF_NO_RTR_SOL +#define GNRC_IPV6_NIB_CONF_NO_RTR_SOL (0) +#endif + /** * @brief Maximum link-layer address length (aligned) */ diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c index f34f88c5ced11409c68e9b56a07979ea9ba5e1e9..e32896d119e97bf59bb7b8727054b4f050965303 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c @@ -24,9 +24,9 @@ #define ENABLE_DEBUG (0) #include "debug.h" +#if GNRC_IPV6_NIB_CONF_6LN || GNRC_IPV6_NIB_CONF_SLAAC static char addr_str[IPV6_ADDR_MAX_STR_LEN]; -#if GNRC_IPV6_NIB_CONF_6LN || GNRC_IPV6_NIB_CONF_SLAAC void _auto_configure_addr(gnrc_netif_t *netif, const ipv6_addr_t *pfx, uint8_t pfx_len) { diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib.c b/sys/net/gnrc/network_layer/ipv6/nib/nib.c index c726827ddcd5ab02dd3e1d0f35032f806328870f..f643e736fb6b81e1ea8feb06803e99f0d766c09f 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/nib.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/nib.c @@ -1227,6 +1227,7 @@ static void _handle_rtr_timeout(_nib_dr_entry_t *router) void _handle_search_rtr(gnrc_netif_t *netif) { +#if !GNRC_IPV6_NIB_CONF_NO_RTR_SOL gnrc_netif_acquire(netif); if (!(gnrc_netif_is_rtr_adv(netif)) || gnrc_netif_is_6ln(netif)) { uint32_t next_rs = _evtimer_lookup(netif, GNRC_IPV6_NIB_SEARCH_RTR); @@ -1249,6 +1250,9 @@ void _handle_search_rtr(gnrc_netif_t *netif) } } gnrc_netif_release(netif); +#else + (void)netif; +#endif /* !GNRC_IPV6_NIB_CONF_NO_RTR_SOL */ } #if GNRC_IPV6_NIB_CONF_DNS diff --git a/tests/gnrc_netif/Makefile b/tests/gnrc_netif/Makefile index 7ec9bc56a440f51d90b020585788b6bea57bdd8b..8492c657f2c0d63d047cda81d0c761eec0fa11f8 100644 --- a/tests/gnrc_netif/Makefile +++ b/tests/gnrc_netif/Makefile @@ -21,6 +21,10 @@ USEMODULE += netdev_ieee802154 USEMODULE += netdev_test USEMODULE += od +# deactivate automatically emitted packets from IPv6 neighbor discovery +CFLAGS += -DGNRC_IPV6_NIB_CONF_ARSM=0 +CFLAGS += -DGNRC_IPV6_NIB_CONF_SLAAC=0 +CFLAGS += -DGNRC_IPV6_NIB_CONF_NO_RTR_SOL=1 CFLAGS += -DGNRC_NETIF_NUMOF=4 CFLAGS += -DGNRC_NETIF_ADDRS_NUMOF=16 CFLAGS += -DGNRC_NETIF_GROUPS_NUMOF=8