From 39255ee8f81641a769358b8a0ce426137eaa2ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= Date: Tue, 15 Mar 2016 16:34:06 +0100 Subject: [PATCH] gnrc_rpl: make DODAG_CONF optional when joining DODAG --- sys/include/net/gnrc/rpl.h | 12 +++++++++++- sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c | 5 +++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sys/include/net/gnrc/rpl.h b/sys/include/net/gnrc/rpl.h index b1c1055cee..d2aa5ba435 100644 --- a/sys/include/net/gnrc/rpl.h +++ b/sys/include/net/gnrc/rpl.h @@ -27,7 +27,7 @@ * CFLAGS * ------ * - * - Exclude Prefix Information Options from DIOs + * - Exclude Prefix Information Options from DIOs * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {.mk} * CFLAGS += -DGNRC_RPL_WITHOUT_PIO * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -39,6 +39,16 @@ * CFLAGS += -DGNRC_RPL_DEFAULT_DIO_REDUNDANCY_CONSTANT=10 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + * - Make reception of DODAG_CONF optional when joining a DODAG. + * This will use the default trickle parameters until a + * DODAG_CONF is received from the parent. The DODAG_CONF is + * requested once from the parent while joining the DODAG. + * 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 + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * * @{ * * @file 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 7563f7189f..e429f60fd5 100644 --- a/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c +++ b/sys/net/gnrc/routing/rpl/gnrc_rpl_control_messages.c @@ -567,10 +567,15 @@ void gnrc_rpl_recv_DIO(gnrc_rpl_dio_t *dio, ipv6_addr_t *src, uint16_t len) } 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); return; +#else + DEBUG("RPL: DIO without DODAG_CONF option - use default trickle parameters\n"); + gnrc_rpl_send_DIS(NULL, src); +#endif } gnrc_rpl_delay_dao(dodag);