diff --git a/examples/emcute_mqttsn/Makefile b/examples/emcute_mqttsn/Makefile index 1796bc2aea..8dd946566e 100644 --- a/examples/emcute_mqttsn/Makefile +++ b/examples/emcute_mqttsn/Makefile @@ -38,7 +38,7 @@ DEVELHELP ?= 1 # Comment this out to join RPL DODAGs even if DIOs do not contain # DODAG Configuration Options (see the doc for more info) -# CFLAGS += -DGNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN +# CFLAGS += -DCONFIG_GNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 diff --git a/examples/gnrc_networking/Makefile b/examples/gnrc_networking/Makefile index 0ae56343f9..610d0bc501 100644 --- a/examples/gnrc_networking/Makefile +++ b/examples/gnrc_networking/Makefile @@ -44,7 +44,7 @@ DEVELHELP ?= 1 # Uncomment this to join RPL DODAGs even if DIOs do not contain # DODAG Configuration Options (see the doc for more info) -# CFLAGS += -DGNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN +# CFLAGS += -DCONFIG_GNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 diff --git a/examples/gnrc_networking_mac/Makefile b/examples/gnrc_networking_mac/Makefile index a64852cd2b..0a380dc843 100644 --- a/examples/gnrc_networking_mac/Makefile +++ b/examples/gnrc_networking_mac/Makefile @@ -53,7 +53,7 @@ DEVELHELP ?= 1 # Uncomment this to join RPL DODAGs even if DIOs do not contain # DODAG Configuration Options (see the doc for more info) -# CFLAGS += -DGNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN +# CFLAGS += -DCONFIG_GNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN # Change this to 0 show compiler invocation lines by default: QUIET ?= 1 diff --git a/sys/include/net/gnrc/rpl.h b/sys/include/net/gnrc/rpl.h index 2b613c8702..c261f7f9fc 100644 --- a/sys/include/net/gnrc/rpl.h +++ b/sys/include/net/gnrc/rpl.h @@ -66,7 +66,7 @@ * The standard behaviour is to request a DODAG_CONF and join * only a DODAG once a DODAG_CONF is received. * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.mk} - * CFLAGS += -DGNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN + * CFLAGS += -DCONFIG_GNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * * - Set interface for auto-initialization if more than one diff --git a/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c b/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c index 3b1f31d972..6e2b95ccf9 100644 --- a/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c +++ b/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c @@ -790,15 +790,16 @@ void gnrc_rpl_recv_DIO(gnrc_rpl_dio_t *dio, kernel_pid_t iface, ipv6_addr_t *src } if (!(included_opts & (((uint32_t) 1) << GNRC_RPL_OPT_DODAG_CONF))) { -#ifndef GNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN - DEBUG("RPL: DIO without DODAG_CONF option - remove DODAG and request new DIO\n"); - gnrc_rpl_instance_remove(inst); - gnrc_rpl_send_DIS(NULL, src, NULL, 0); - return; -#else - DEBUG("RPL: DIO without DODAG_CONF option - use default trickle parameters\n"); - gnrc_rpl_send_DIS(NULL, src, NULL, 0); -#endif + if (!IS_ACTIVE(CONFIG_GNRC_RPL_DODAG_CONF_OPTIONAL_ON_JOIN)) { + DEBUG("RPL: DIO without DODAG_CONF option - remove DODAG and request new DIO\n"); + gnrc_rpl_instance_remove(inst); + gnrc_rpl_send_DIS(NULL, src, NULL, 0); + return; + } + else { + DEBUG("RPL: DIO without DODAG_CONF option - use default trickle parameters\n"); + gnrc_rpl_send_DIS(NULL, src, NULL, 0); + } } /* if there was no address created manually or by a PIO on the interface,