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);

View file

@ -281,11 +281,11 @@ rpl_ipv6_neighbor_callback(uip_ds6_nbr_t *nbr)
PRINTF("RPL: Neighbor state changed for ");
PRINT6ADDR(&nbr->ipaddr);
#if UIP_ND6_SEND_NA || UIP_ND6_SEND_RA
#if UIP_ND6_SEND_NS || UIP_ND6_SEND_RA
PRINTF(", nscount=%u, state=%u\n", nbr->nscount, nbr->state);
#else /* UIP_ND6_SEND_NA || UIP_ND6_SEND_RA */
#else /* UIP_ND6_SEND_NS || UIP_ND6_SEND_RA */
PRINTF(", state=%u\n", nbr->state);
#endif /* UIP_ND6_SEND_NA || UIP_ND6_SEND_RA */
#endif /* UIP_ND6_SEND_NS || UIP_ND6_SEND_RA */
for(instance = &instance_table[0], end = instance + RPL_MAX_INSTANCES; instance < end; ++instance) {
if(instance->used == 1 ) {
p = rpl_find_parent_any_dag(instance, &nbr->ipaddr);