Merge pull request #2073 from cetic/pr-fix-send-na
Fix semantic of UIP_ND6_SEND_NA and add UIP_ND6_SEND_NS
This commit is contained in:
commit
5eb2ac15ff
19 changed files with 75 additions and 61 deletions
|
@ -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);
|
||||
}
|
||||
|
@ -877,7 +877,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 */
|
||||
|
@ -885,7 +885,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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue