RPL: re-enable RPL_DIO_REFRESH_DAO_ROUTES by default as it is needed with DAO-ACK disabled. Now increments the DTSN only at the root

This commit is contained in:
Simon Duquennoy 2016-06-03 21:17:05 +02:00 committed by Simon Duquennoy
parent c3ea1f9fc6
commit 343c274359
2 changed files with 9 additions and 6 deletions

View File

@ -257,15 +257,16 @@
#endif /* RPL_CONF_RPL_REPAIR_ON_DAO_NACK */
/*
* Setting the DIO_REFRESH_DAO_ROUTES will make RPL always increase
* the DTSN (Destination Advertisement Trigger Sequence Number) when
* sending broadcast DIO. This is to get all children to re-register
* their DAO route.
* Setting the DIO_REFRESH_DAO_ROUTES will make the RPL root always
* increase the DTSN (Destination Advertisement Trigger Sequence Number)
* when sending multicast DIO. This is to get all children to re-register
* their DAO route. This is needed when DAO-ACK is not enabled to add
* reliability to route maintenance.
* */
#ifdef RPL_CONF_DIO_REFRESH_DAO_ROUTES
#define RPL_DIO_REFRESH_DAO_ROUTES RPL_CONF_DIO_REFRESH_DAO_ROUTES
#else
#define RPL_DIO_REFRESH_DAO_ROUTES 0
#define RPL_DIO_REFRESH_DAO_ROUTES 1
#endif /* RPL_CONF_DIO_REFRESH_DAO_ROUTES */
/*

View File

@ -479,6 +479,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr)
{
unsigned char *buffer;
int pos;
int is_root;
rpl_dag_t *dag = instance->current_dag;
#if !RPL_LEAF_ONLY
uip_ipaddr_t addr;
@ -499,6 +500,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr)
buffer = UIP_ICMP_PAYLOAD;
buffer[pos++] = instance->instance_id;
buffer[pos++] = dag->version;
is_root = (dag->rank == ROOT_RANK(instance));
#if RPL_LEAF_ONLY
PRINTF("RPL: LEAF ONLY DIO rank set to INFINITE_RANK\n");
@ -519,7 +521,7 @@ dio_output(rpl_instance_t *instance, uip_ipaddr_t *uc_addr)
buffer[pos++] = instance->dtsn_out;
if(RPL_DIO_REFRESH_DAO_ROUTES && uc_addr == NULL) {
if(RPL_DIO_REFRESH_DAO_ROUTES && is_root && uc_addr == NULL) {
/* Request new DAO to refresh route. We do not do this for unicast DIO
* in order to avoid DAO messages after a DIS-DIO update,
* or upon unicast DIO probing. */