1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

6lowpan netif: set prefixes for 6LBR first

By adding a newly added prefix first, it is assured that the following router advertisement will already disseminate it via the PIO.
This commit is contained in:
Oleg Hahm 2015-09-24 13:15:38 +02:00
parent 5e2b4b6b23
commit bb287ae7e8

View File

@ -106,6 +106,13 @@ static ipv6_addr_t *_add_addr_to_entry(gnrc_ipv6_netif_t *entry, const ipv6_addr
}
else {
if (!ipv6_addr_is_link_local(addr)) {
#ifdef MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER
tmp_addr->valid = 0xFFFF;
gnrc_sixlowpan_nd_router_abr_t *abr = gnrc_sixlowpan_nd_router_abr_get();
if (gnrc_sixlowpan_nd_router_abr_add_prf(abr, entry, tmp_addr) < 0) {
DEBUG("ipv6_netif: error adding prefix to 6LoWPAN-ND management\n");
}
#endif
#if defined(MODULE_GNRC_NDP_ROUTER) || defined(MODULE_GNRC_SIXLOWPAN_ND_ROUTER)
if ((entry->flags & GNRC_IPV6_NETIF_FLAGS_ROUTER) &&
(entry->flags & GNRC_IPV6_NETIF_FLAGS_RTR_ADV)) {
@ -126,13 +133,6 @@ static ipv6_addr_t *_add_addr_to_entry(gnrc_ipv6_netif_t *entry, const ipv6_addr
#endif
mutex_lock(&entry->mutex); /* relock mutex */
}
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER
tmp_addr->valid = 0xFFFF;
gnrc_sixlowpan_nd_router_abr_t *abr = gnrc_sixlowpan_nd_router_abr_get();
if (gnrc_sixlowpan_nd_router_abr_add_prf(abr, entry, tmp_addr) < 0) {
DEBUG("ipv6_netif: error adding prefix to 6LoWPAN-ND management\n");
}
#endif
}
else {