Browse Source

gnrc_sixlowpan_nd: activate NC state machine

dev/timer
Martine Lenders 7 years ago
parent
commit
79c1240590
  1. 7
      sys/net/gnrc/network_layer/ndp/gnrc_ndp.c
  2. 3
      sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c

7
sys/net/gnrc/network_layer/ndp/gnrc_ndp.c

@ -74,6 +74,12 @@ static void _stale_nc(kernel_pid_t iface, ipv6_addr_t *ipaddr, uint8_t *l2addr,
gnrc_ipv6_nc_add(iface, ipaddr, l2addr, (uint16_t)l2addr_len,
GNRC_IPV6_NC_STATE_STALE);
}
#ifdef MODULE_GNRC_SIXLOWPAN_ND_ROUTER
/* unreachable set in gnrc_ndp_retrans_nbr_sol() will just be staled */
else if (gnrc_ipv6_nc_get_state(nc_entry) == GNRC_IPV6_NC_STATE_UNREACHABLE) {
gnrc_ndp_internal_set_state(nc_entry, GNRC_IPV6_NC_STATE_STALE);
}
#endif
else if (((uint16_t)l2addr_len != nc_entry->l2_addr_len) ||
(memcmp(l2addr, nc_entry->l2_addr, l2addr_len) != 0)) {
/* if entry exists but l2 address differs: set */
@ -672,6 +678,7 @@ void gnrc_ndp_retrans_nbr_sol(gnrc_ipv6_nc_t *nc_entry)
(gnrc_ipv6_nc_get_type(nc_entry) != GNRC_IPV6_NC_TYPE_GC)) {
/* don't remove non-gc entrys on 6LRs:
* https://tools.ietf.org/html/rfc6775#section-6 */
gnrc_ndp_internal_set_state(nc_entry, GNRC_IPV6_NC_STATE_UNREACHABLE);
return;
}
}

3
sys/net/gnrc/network_layer/sixlowpan/nd/gnrc_sixlowpan_nd.c

@ -210,6 +210,9 @@ kernel_pid_t gnrc_sixlowpan_nd_next_hop_l2addr(uint8_t *l2addr, uint8_t *l2addr_
memcpy(l2addr, nc_entry->l2_addr, nc_entry->l2_addr_len);
}
*l2addr_len = nc_entry->l2_addr_len;
if (gnrc_ipv6_nc_get_state(nc_entry) == GNRC_IPV6_NC_STATE_STALE) {
gnrc_ndp_internal_set_state(nc_entry, GNRC_IPV6_NC_STATE_DELAY);
}
}
return nc_entry->iface;
}

Loading…
Cancel
Save