Skip to content

Commit

Permalink
ipv6/nib: 6LBR should not send RS on their downstream interface
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian18 committed May 22, 2023
1 parent 3917c29 commit 2749744
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions sys/net/gnrc/network_layer/ipv6/nib/nib.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ void gnrc_ipv6_nib_iface_up(gnrc_netif_t *netif)
#endif /* CONFIG_GNRC_IPV6_NIB_6LN */
netif->ipv6.na_sent = 0;
_auto_configure_addr(netif, &ipv6_addr_link_local_prefix, 64U);
if (!(gnrc_netif_is_rtr_adv(netif)) ||
(gnrc_netif_is_6ln(netif) && !gnrc_netif_is_6lbr(netif))) {
if (!gnrc_netif_is_6lbr(netif) &&
(!gnrc_netif_is_rtr_adv(netif) || gnrc_netif_is_6ln(netif))) {
uint32_t next_rs_time = random_uint32_range(0, NDP_MAX_RS_MS_DELAY);

_evtimer_add(netif, GNRC_IPV6_NIB_SEARCH_RTR, &netif->ipv6.search_rtr,
Expand All @@ -160,8 +160,8 @@ void gnrc_ipv6_nib_iface_down(gnrc_netif_t *netif, bool send_final_ra)
gnrc_netif_acquire(netif);

_deinit_iface_arsm(netif);
if (!(gnrc_netif_is_rtr_adv(netif)) ||
(gnrc_netif_is_6ln(netif) && !gnrc_netif_is_6lbr(netif))) {
if (!gnrc_netif_is_6lbr(netif) &&
(!gnrc_netif_is_rtr_adv(netif) || gnrc_netif_is_6ln(netif))) {
_evtimer_del(&netif->ipv6.search_rtr);
}
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ROUTER)
Expand Down Expand Up @@ -482,8 +482,10 @@ void gnrc_ipv6_nib_change_rtr_adv_iface(gnrc_netif_t *netif, bool enable)
netif->flags &= ~GNRC_NETIF_FLAGS_IPV6_RTR_ADV;
/* send final router advertisements */
_handle_snd_mc_ra(netif);
_evtimer_add(netif, GNRC_IPV6_NIB_SEARCH_RTR, &netif->ipv6.search_rtr,
next_rs_time);
if (!gnrc_netif_is_6lbr(netif)) {
_evtimer_add(netif, GNRC_IPV6_NIB_SEARCH_RTR,
&netif->ipv6.search_rtr, next_rs_time);
}
}
gnrc_netif_release(netif);
}
Expand Down Expand Up @@ -858,7 +860,9 @@ static void _handle_rtr_adv(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,

/* stop sending router solicitations
* see https://tools.ietf.org/html/rfc4861#section-6.3.7 */
evtimer_del(&_nib_evtimer, &netif->ipv6.search_rtr.event);
if (!gnrc_netif_is_6lbr(netif)) {
evtimer_del(&_nib_evtimer, &netif->ipv6.search_rtr.event);
}
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN)
if (gnrc_netif_is_6ln(netif) && !gnrc_netif_is_6lbr(netif)) {
if (IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C)) {
Expand Down Expand Up @@ -1461,7 +1465,8 @@ void _handle_search_rtr(gnrc_netif_t *netif)
{
#if !IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_NO_RTR_SOL)
gnrc_netif_acquire(netif);
if (!(gnrc_netif_is_rtr_adv(netif)) || gnrc_netif_is_6ln(netif)) {
if (!gnrc_netif_is_6lbr(netif) &&
(!gnrc_netif_is_rtr_adv(netif) || gnrc_netif_is_6ln(netif))) {
uint32_t next_rs = _evtimer_lookup(netif, GNRC_IPV6_NIB_SEARCH_RTR);
uint32_t interval = _get_next_rs_interval(netif);

Expand Down

0 comments on commit 2749744

Please sign in to comment.