Skip to content

Commit

Permalink
Merge pull request contiki-os#895 from simonduq/rpl-single-dag
Browse files Browse the repository at this point in the history
Do not use rpl_add_dag when RPL is used with a single dag per instance
  • Loading branch information
Nicolas Tsiftes committed Feb 26, 2015
2 parents bfd2a90 + 29d631c commit f9e5e24
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions core/net/rpl/rpl-dag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 */
}


Expand Down

0 comments on commit f9e5e24

Please sign in to comment.