Merge pull request #895 from simonduq/rpl-single-dag

Do not use rpl_add_dag when RPL is used with a single dag per instance
This commit is contained in:
Nicolas Tsiftes 2015-02-26 11:41:24 +01:00
commit f9e5e24cf4

View File

@ -972,6 +972,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)
@ -1051,6 +1052,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
@ -1246,9 +1248,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 */
}