Skip to content

Commit bed34da

Browse files
committed
gnrc_netif: always join solicited-node multicast group if 6LN
A border router will send a neighbor solicitation to the solicited-node multicasts if it encounters a packet from a global address that is not registered with the border router. This happens when the border router is restarted while some nodes were online. As the nodes were not in the solicited-node multicast group, they would drop the neighbor solicitation which resulted in them not being able to route any packets through the border router until they would reboot themself (or their prefix expired). To fix this, always join the solicited-node multicast address as a 6LN. This allows to have a connection across BR restarts.
1 parent f49ca58 commit bed34da

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

sys/net/gnrc/netif/gnrc_netif.c

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -585,32 +585,30 @@ int gnrc_netif_ipv6_addr_add_internal(gnrc_netif_t *netif,
585585
gnrc_netif_release(netif);
586586
return -ENOMEM;
587587
}
588-
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM)
589-
ipv6_addr_t sol_nodes;
590-
int res;
591-
592-
/* TODO: SHOULD delay join between 0 and MAX_RTR_SOLICITATION_DELAY
593-
* for SLAAC */
594-
ipv6_addr_set_solicited_nodes(&sol_nodes, addr);
595-
res = gnrc_netif_ipv6_group_join_internal(netif, &sol_nodes);
596-
if (res < 0) {
597-
DEBUG("gnrc_netif: Can't join solicited-nodes of %s on interface %"
598-
PRIkernel_pid "\n",
599-
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)),
600-
netif->pid);
601-
gnrc_netif_release(netif);
602-
return res;
603-
}
604-
#else /* CONFIG_GNRC_IPV6_NIB_ARSM */
605-
if (!gnrc_netif_is_6ln(netif)) {
588+
if (IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM) || gnrc_netif_is_6ln(netif)) {
589+
ipv6_addr_t sol_nodes;
590+
int res;
591+
592+
/* TODO: SHOULD delay join between 0 and MAX_RTR_SOLICITATION_DELAY
593+
* for SLAAC */
594+
ipv6_addr_set_solicited_nodes(&sol_nodes, addr);
595+
res = gnrc_netif_ipv6_group_join_internal(netif, &sol_nodes);
596+
if (res < 0) {
597+
DEBUG("gnrc_netif: Can't join solicited-nodes of %s on interface %"
598+
PRIkernel_pid "\n",
599+
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)),
600+
netif->pid);
601+
gnrc_netif_release(netif);
602+
return res;
603+
}
604+
} else {
606605
LOG_WARNING("Address-resolution state-machine not activated. Neighbors "
607606
"from interface %u\nwill not be able to resolve address "
608607
"%s\n"
609608
" Use CONFIG_GNRC_IPV6_NIB_ARSM=1 to activate.\n",
610609
netif->pid, ipv6_addr_to_str(addr_str, addr,
611610
sizeof(addr_str)));
612611
}
613-
#endif /* CONFIG_GNRC_IPV6_NIB_ARSM */
614612
netif->ipv6.addrs_flags[idx] = flags;
615613
memcpy(&netif->ipv6.addrs[idx], addr, sizeof(netif->ipv6.addrs[idx]));
616614
#ifdef MODULE_GNRC_IPV6_NIB

0 commit comments

Comments
 (0)