Fix semantic of UIP_ND6_SEND_NA and add UIP_ND6_SEND_NS

This commit is contained in:
Laurent Deru 2017-01-16 13:44:15 +01:00
parent c1f11cfaa9
commit 12c930893c
19 changed files with 75 additions and 61 deletions

View file

@ -215,13 +215,13 @@ rpl_parent_is_reachable(rpl_parent_t *p) {
if(p == NULL || p->dag == NULL || p->dag->instance == NULL || p->dag->instance->of == NULL) {
return 0;
} else {
#ifndef UIP_CONF_ND6_SEND_NA
#if UIP_ND6_SEND_NS
uip_ds6_nbr_t *nbr = rpl_get_nbr(p);
/* Exclude links to a neighbor that is not reachable at a NUD level */
if(nbr == NULL || nbr->state != NBR_REACHABLE) {
return 0;
}
#endif /* UIP_CONF_ND6_SEND_NA */
#endif /* UIP_ND6_SEND_NS */
/* If we don't have fresh link information, assume the parent is reachable. */
return !rpl_parent_is_fresh(p) || p->dag->instance->of->parent_has_usable_link(p);
}
@ -874,7 +874,7 @@ best_parent(rpl_dag_t *dag, int fresh_only)
continue;
}
#ifndef UIP_CONF_ND6_SEND_NA
#if UIP_ND6_SEND_NS
{
uip_ds6_nbr_t *nbr = rpl_get_nbr(p);
/* Exclude links to a neighbor that is not reachable at a NUD level */
@ -882,7 +882,7 @@ best_parent(rpl_dag_t *dag, int fresh_only)
continue;
}
}
#endif /* UIP_CONF_ND6_SEND_NA */
#endif /* UIP_ND6_SEND_NS */
/* Now we have an acceptable parent, check if it is the new best */
best = of->best_parent(best, p);