Add a neighbor table entry if a DAO is received from a node where we don't yet have a neighbor table entry.
This commit is contained in:
parent
490791eaa4
commit
4e6fe7dda6
3 changed files with 46 additions and 2 deletions
|
@ -701,8 +701,8 @@ rpl_select_dag(rpl_instance_t *instance, rpl_parent_t *p)
|
|||
return best_dag;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
rpl_parent_t *
|
||||
rpl_select_parent(rpl_dag_t *dag)
|
||||
static rpl_parent_t *
|
||||
best_parent(rpl_dag_t *dag)
|
||||
{
|
||||
rpl_parent_t *p, *best;
|
||||
|
||||
|
@ -720,6 +720,14 @@ rpl_select_parent(rpl_dag_t *dag)
|
|||
p = nbr_table_next(rpl_parents, p);
|
||||
}
|
||||
|
||||
return best;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
rpl_parent_t *
|
||||
rpl_select_parent(rpl_dag_t *dag)
|
||||
{
|
||||
rpl_parent_t *best = best_parent(dag);
|
||||
|
||||
if(best != NULL) {
|
||||
rpl_set_preferred_parent(dag, best);
|
||||
}
|
||||
|
@ -1289,4 +1297,10 @@ rpl_process_dio(uip_ipaddr_t *from, rpl_dio_t *dio)
|
|||
p->dtsn = dio->dtsn;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
rpl_lock_parent(rpl_parent_t *p)
|
||||
{
|
||||
nbr_table_lock(rpl_parents, p);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#endif /* UIP_CONF_IPV6 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue