Skip to content
Snippets Groups Projects
Unverified Commit cea0d132 authored by Koen Zandberg's avatar Koen Zandberg Committed by GitHub
Browse files

Merge pull request #8393 from miri64/gnrc_ipv6_nib/fix/final-ras

gnrc_ipv6_nib: fix final RA behavior
parents 76942635 70c1fb7b
No related branches found
No related tags found
No related merge requests found
...@@ -52,10 +52,13 @@ void _handle_snd_mc_ra(gnrc_netif_t *netif) ...@@ -52,10 +52,13 @@ void _handle_snd_mc_ra(gnrc_netif_t *netif)
bool final_ra = (netif->ipv6.ra_sent > (UINT8_MAX - NDP_MAX_FIN_RA_NUMOF)); bool final_ra = (netif->ipv6.ra_sent > (UINT8_MAX - NDP_MAX_FIN_RA_NUMOF));
uint32_t next_ra_time = random_uint32_range(NDP_MIN_RA_INTERVAL_MS, uint32_t next_ra_time = random_uint32_range(NDP_MIN_RA_INTERVAL_MS,
NDP_MAX_RA_INTERVAL_MS); NDP_MAX_RA_INTERVAL_MS);
uint32_t next_scheduled = _evtimer_lookup(netif, GNRC_IPV6_NIB_SND_MC_RA);
/* router has router advertising interface or the RA is one of the /* router has router advertising interface or the RA is one of the
* (now deactivated) routers final one */ * (now deactivated) routers final one (and there is no next
if (final_ra || gnrc_netif_is_rtr_adv(netif)) { * scheduled within the possible time for next_ra_time) */
if ((final_ra && (next_scheduled > NDP_MAX_RA_INTERVAL_MS)) ||
gnrc_netif_is_rtr_adv(netif)) {
_snd_rtr_advs(netif, NULL, final_ra); _snd_rtr_advs(netif, NULL, final_ra);
netif->ipv6.last_ra = (xtimer_now_usec64() / US_PER_MS) & UINT32_MAX; netif->ipv6.last_ra = (xtimer_now_usec64() / US_PER_MS) & UINT32_MAX;
if ((netif->ipv6.ra_sent < NDP_MAX_INIT_RA_NUMOF) || final_ra) { if ((netif->ipv6.ra_sent < NDP_MAX_INIT_RA_NUMOF) || final_ra) {
...@@ -190,7 +193,11 @@ void _set_rtr_adv(gnrc_netif_t *netif) ...@@ -190,7 +193,11 @@ void _set_rtr_adv(gnrc_netif_t *netif)
static void _snd_ra(gnrc_netif_t *netif, const ipv6_addr_t *dst, static void _snd_ra(gnrc_netif_t *netif, const ipv6_addr_t *dst,
bool final, _nib_abr_entry_t *abr) bool final, _nib_abr_entry_t *abr)
{ {
gnrc_pktsnip_t *ext_opts = _build_ext_opts(netif, abr); gnrc_pktsnip_t *ext_opts = NULL;
if (!final) {
ext_opts = _build_ext_opts(netif, abr);
}
gnrc_ndp_rtr_adv_send(netif, NULL, dst, final, ext_opts); gnrc_ndp_rtr_adv_send(netif, NULL, dst, final, ext_opts);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment