ND6: Always set neighbor_cache.state together with counter value to avoid inconsistency

This commit is contained in:
Dirk Ziegelmeier 2016-10-04 13:59:05 +02:00
parent ec236da972
commit bef7873042

View File

@ -231,8 +231,6 @@ nd6_input(struct pbuf *p, struct netif *inp)
}
/* Update cache entry. */
neighbor_cache[i].netif = inp;
neighbor_cache[i].counter.reachable_time = reachable_time;
if ((na_hdr->flags & ND6_FLAG_OVERRIDE) ||
(neighbor_cache[i].state == ND6_INCOMPLETE)) {
/* Check that link-layer address option also fits in packet. */
@ -256,7 +254,10 @@ nd6_input(struct pbuf *p, struct netif *inp)
MEMCPY(neighbor_cache[i].lladdr, lladdr_opt->addr, inp->hwaddr_len);
}
neighbor_cache[i].netif = inp;
neighbor_cache[i].state = ND6_REACHABLE;
neighbor_cache[i].counter.reachable_time = reachable_time;
/* Send queued packets, if any. */
if (neighbor_cache[i].q != NULL) {