From aadfaa7fbe8b362f178da476d885f46de9a790b4 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Mon, 6 Aug 2018 14:47:01 +0200 Subject: [PATCH] gnrc_ipv6_nib: make RS emission configurable (cherry picked from commit bdb1e80e0a44b4cddd1b135cd2df66bd6b4e7137) --- sys/include/net/gnrc/ipv6/nib/conf.h | 9 +++++++++ sys/net/gnrc/network_layer/ipv6/nib/nib.c | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/sys/include/net/gnrc/ipv6/nib/conf.h b/sys/include/net/gnrc/ipv6/nib/conf.h index d85942878..b26c0e68d 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.c b/sys/net/gnrc/network_layer/ipv6/nib/nib.c index c726827dd..f643e736f 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