Do not use rpl_add_dag when RPL is used with a single dag per instance

This commit is contained in:
Simon Duquennoy 2014-12-03 16:46:17 +01:00
parent 9e7927e415
commit 29d631c6f5

View File

@ -948,6 +948,7 @@ rpl_join_instance(uip_ipaddr_t *from, rpl_dio_t *dio)
}
}
#if RPL_MAX_DAG_PER_INSTANCE > 1
/*---------------------------------------------------------------------------*/
void
rpl_add_dag(uip_ipaddr_t *from, rpl_dio_t *dio)
@ -1027,6 +1028,7 @@ rpl_add_dag(uip_ipaddr_t *from, rpl_dio_t *dio)
rpl_process_parent_event(instance, p);
p->dtsn = dio->dtsn;
}
#endif /* RPL_MAX_DAG_PER_INSTANCE > 1 */
/*---------------------------------------------------------------------------*/
static void
@ -1214,9 +1216,14 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
}
if(dag == NULL) {
#if RPL_MAX_DAG_PER_INSTANCE > 1
PRINTF("RPL: Adding new DAG to known instance.\n");
rpl_add_dag(from, dio);
return;
#else /* RPL_MAX_DAG_PER_INSTANCE > 1 */
PRINTF("RPL: Only one instance supported.\n");
return;
#endif /* RPL_MAX_DAG_PER_INSTANCE > 1 */
}