From fe3d620a63169e05f006bf7dcbcd338adf26863f Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Fri, 22 Jul 2022 16:59:00 +0200 Subject: [PATCH] gnrc_ipv6_nib: make configurable via Kconfig again --- sys/include/net/gnrc/ipv6/nib/conf.h | 8 +++++++- sys/net/gnrc/Makefile.dep | 4 ---- sys/net/gnrc/network_layer/ipv6/nib/Kconfig | 15 +++++++++++++++ 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/sys/include/net/gnrc/ipv6/nib/conf.h b/sys/include/net/gnrc/ipv6/nib/conf.h index 45b5c56fce..5ffd878d55 100644 --- a/sys/include/net/gnrc/ipv6/nib/conf.h +++ b/sys/include/net/gnrc/ipv6/nib/conf.h @@ -134,7 +134,9 @@ extern "C" { */ #ifndef CONFIG_GNRC_IPV6_NIB_ADV_ROUTER #if CONFIG_GNRC_IPV6_NIB_ROUTER && \ - (!CONFIG_GNRC_IPV6_NIB_6LR || CONFIG_GNRC_IPV6_NIB_6LBR) + (!CONFIG_GNRC_IPV6_NIB_6LR || CONFIG_GNRC_IPV6_NIB_6LBR) && \ + !(IS_USED(MODULE_GNRC_DHCPV6_CLIENT_IA_PD) || IS_USED(MODULE_GNRC_UHCPC) || \ + IS_USED(MODULE_GNRC_IPV6_AUTO_SUBNETS)) #define CONFIG_GNRC_IPV6_NIB_ADV_ROUTER 1 #else #define CONFIG_GNRC_IPV6_NIB_ADV_ROUTER 0 @@ -149,8 +151,12 @@ extern "C" { * Requires the `gnrc_ipv6_nib_rio` module. */ #ifndef CONFIG_GNRC_IPV6_NIB_ADD_RIO_IN_LAST_RA +#if IS_USED(MODULE_GNRC_IPV6_AUTO_SUBNETS) +#define CONFIG_GNRC_IPV6_NIB_ADD_RIO_IN_LAST_RA 1 +#else #define CONFIG_GNRC_IPV6_NIB_ADD_RIO_IN_LAST_RA 0 #endif +#endif /** * @brief (de-)activate NDP address resolution state-machine diff --git a/sys/net/gnrc/Makefile.dep b/sys/net/gnrc/Makefile.dep index 50eb101f24..4e38f00876 100644 --- a/sys/net/gnrc/Makefile.dep +++ b/sys/net/gnrc/Makefile.dep @@ -65,7 +65,6 @@ endif ifneq (,$(filter gnrc_dhcpv6_client_simple_pd,$(USEMODULE))) USEMODULE += gnrc_dhcpv6_client USEMODULE += dhcpv6_client_ia_pd - CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ADV_ROUTER=0 endif ifneq (,$(filter gnrc_uhcpc,$(USEMODULE))) @@ -73,7 +72,6 @@ ifneq (,$(filter gnrc_uhcpc,$(USEMODULE))) USEMODULE += uhcpc USEMODULE += gnrc_sock_udp USEMODULE += fmt - CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ADV_ROUTER=0 endif ifneq (,$(filter gnrc_%,$(filter-out gnrc_lorawan gnrc_netapi gnrc_netreg gnrc_netif% gnrc_pkt%,$(USEMODULE)))) @@ -130,8 +128,6 @@ endif ifneq (,$(filter gnrc_ipv6_auto_subnets,$(USEMODULE))) USEMODULE += gnrc_ipv6_nib_rtr_adv_pio_cb - CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ADV_ROUTER=0 - CFLAGS += -DCONFIG_GNRC_IPV6_NIB_ADD_RIO_IN_LAST_RA=1 USEMODULE += xtimer ifeq (,$(filter gnrc_ipv6_auto_subnets_simple,$(USEMODULE))) DEFAULT_MODULE += gnrc_ipv6_auto_subnets_auto_init diff --git a/sys/net/gnrc/network_layer/ipv6/nib/Kconfig b/sys/net/gnrc/network_layer/ipv6/nib/Kconfig index 8370ed8d0f..ae5a9ad76f 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/Kconfig +++ b/sys/net/gnrc/network_layer/ipv6/nib/Kconfig @@ -57,8 +57,23 @@ config GNRC_IPV6_NIB_DNS config GNRC_IPV6_NIB_ADV_ROUTER bool "Activate router advertising at interface start-up" + default n if USEMODULE_GNRC_DHCPV6_CLIENT_IA_PD || USEMODULE_GNRC_UHCPC + default n if USEMODULE_GNRC_IPV6_AUTO_SUBNETS default y if GNRC_IPV6_NIB_ROUTER && (!GNRC_IPV6_NIB_6LR || GNRC_IPV6_NIB_6LBR) +config GNRC_IPV6_NIB_ADD_RIO_IN_LAST_RA + bool "Include a Route Information Option for subnets" + default y if USEMODULE_GNRC_IPV6_AUTO_SUBNETS + default n + help + on other interfaces in the last Router Advertisement + generated by @ref gnrc_ipv6_nib_change_rtr_adv_iface + +if GNRC_IPV6_NIB_ADD_RIO_IN_LAST_RA +comment "Activating inclusion of the Route Information Option" +comment "requires the `gnrc_ipv6_nib_rio` module." +endif + config GNRC_IPV6_NIB_DC bool "Destination cache"