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

Merge pull request #3889 from OlegHahm/6lowpan_nd_rtr_adv

6lowpan nd: send router advertisements on 6LR
This commit is contained in:
Martine Lenders 2015-09-20 20:51:47 +02:00
commit c1310d5500
2 changed files with 15 additions and 5 deletions

View File

@ -105,15 +105,22 @@ 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_NDP_ROUTER
/* New prefixes MAY allow the router to retransmit up to
* GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF unsolicited RA
* (see https://tools.ietf.org/html/rfc4861#section-6.2.4) */
#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)) {
entry->rtr_adv_count = GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF;
mutex_unlock(&entry->mutex); /* function below relocks mutex */
#ifdef MODULE_GNRC_NDP_ROUTER
/* New prefixes MAY allow the router to retransmit up to
* GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF unsolicited RA
* (see https://tools.ietf.org/html/rfc4861#section-6.2.4) */
entry->rtr_adv_count = GNRC_NDP_MAX_INIT_RTR_ADV_NUMOF;
gnrc_ndp_router_retrans_rtr_adv(entry);
#elif defined(MODULE_GNRC_SIXLOWPAN_ND_ROUTER)
if (entry->flags & GNRC_IPV6_NETIF_FLAGS_SIXLOWPAN) {
gnrc_ndp_internal_send_rtr_adv(entry->pid, &tmp_addr->addr,
NULL, false);
}
#endif
mutex_lock(&entry->mutex); /* relock mutex */
}
#endif

View File

@ -619,6 +619,9 @@ void gnrc_ndp_rtr_adv_handle(kernel_pid_t iface, gnrc_pktsnip_t *pkt, ipv6_hdr_t
gnrc_sixlowpan_nd_rtr_sol_reschedule(nc_entry, next_rtr_sol);
gnrc_ndp_internal_send_nbr_sol(nc_entry->iface, NULL, &nc_entry->ipv6_addr,
&nc_entry->ipv6_addr);
if (if_entry->flags & GNRC_IPV6_NETIF_FLAGS_ROUTER) {
gnrc_ipv6_netif_set_rtr_adv(if_entry, true);
}
}
#endif
}