Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gnrc_netif: add option to always join solicited-node multicast group (for connectivity across border router restart) #16988

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions sys/include/net/gnrc/ipv6/nib/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,20 @@ extern "C" {
#define CONFIG_GNRC_IPV6_NIB_ARSM 1
#endif

/**
* @brief Join solicited-node multicast address on interface initialization
*
* Enable this if you want your 6LoWPAN network to recover
* from a border router restart.
benpicco marked this conversation as resolved.
Show resolved Hide resolved
*/
#ifndef CONFIG_GNRC_IPV6_NIB_JOIN_SOLICITED_NODES
#if CONFIG_GNRC_IPV6_NIB_ARSM
#define CONFIG_GNRC_IPV6_NIB_JOIN_SOLICITED_NODES 1
#else
#define CONFIG_GNRC_IPV6_NIB_JOIN_SOLICITED_NODES 0
#endif
#endif

/**
* @brief queue packets for address resolution
*/
Expand Down
35 changes: 17 additions & 18 deletions sys/net/gnrc/netif/gnrc_netif.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,32 +585,31 @@ int gnrc_netif_ipv6_addr_add_internal(gnrc_netif_t *netif,
gnrc_netif_release(netif);
return -ENOMEM;
}
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_ARSM)
ipv6_addr_t sol_nodes;
int res;

/* TODO: SHOULD delay join between 0 and MAX_RTR_SOLICITATION_DELAY
* for SLAAC */
ipv6_addr_set_solicited_nodes(&sol_nodes, addr);
res = gnrc_netif_ipv6_group_join_internal(netif, &sol_nodes);
if (res < 0) {
DEBUG("gnrc_netif: Can't join solicited-nodes of %s on interface %"
PRIkernel_pid "\n",
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)),
netif->pid);
gnrc_netif_release(netif);
return res;
if (IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_JOIN_SOLICITED_NODES)) {
ipv6_addr_t sol_nodes;
int res;

/* TODO: SHOULD delay join between 0 and MAX_RTR_SOLICITATION_DELAY
* for SLAAC */
ipv6_addr_set_solicited_nodes(&sol_nodes, addr);
res = gnrc_netif_ipv6_group_join_internal(netif, &sol_nodes);
if (res < 0) {
DEBUG("gnrc_netif: Can't join solicited-nodes of %s on interface %"
PRIkernel_pid "\n",
ipv6_addr_to_str(addr_str, addr, sizeof(addr_str)),
netif->pid);
gnrc_netif_release(netif);
return res;
}
}
#else /* CONFIG_GNRC_IPV6_NIB_ARSM */
if (!gnrc_netif_is_6ln(netif)) {
else if (!gnrc_netif_is_6ln(netif)) {
LOG_WARNING("Address-resolution state-machine not activated. Neighbors "
"from interface %u\nwill not be able to resolve address "
"%s\n"
" Use CONFIG_GNRC_IPV6_NIB_ARSM=1 to activate.\n",
netif->pid, ipv6_addr_to_str(addr_str, addr,
sizeof(addr_str)));
miri64 marked this conversation as resolved.
Show resolved Hide resolved
}
#endif /* CONFIG_GNRC_IPV6_NIB_ARSM */
netif->ipv6.addrs_flags[idx] = flags;
memcpy(&netif->ipv6.addrs[idx], addr, sizeof(netif->ipv6.addrs[idx]));
#ifdef MODULE_GNRC_IPV6_NIB
Expand Down
6 changes: 6 additions & 0 deletions sys/net/gnrc/network_layer/ipv6/nib/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ config GNRC_IPV6_NIB_ARSM
default n if USEMODULE_GNRC_IPV6_NIB_6LN && !GNRC_IPV6_NIB_6LR
default y

config GNRC_IPV6_NIB_JOIN_SOLICITED_NODES
bool "Join solicited-node multicast address on interface initialization"
default y if GNRC_IPV6_NIB_ARSM
help
Enable this if you want your 6LoWPAN network to recover from a border router restart.

config GNRC_IPV6_NIB_DNS
bool "Support for DNS configuration options"
default y if USEMODULE_GNRC_IPV6_NIB_DNS
Expand Down