1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 01:53:51 +01:00

Merge pull request #21437 from benpicco/CONFIG_GNRC_IPV6_NIB_SOL_ROUTER

gnrc/ipv6/nib: add option to disable router solicitations
This commit is contained in:
benpicco 2025-04-28 16:08:10 +00:00 committed by GitHub
commit d973ca18a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 98 additions and 86 deletions

View File

@ -50,9 +50,8 @@ extern "C" {
# ifndef CONFIG_GNRC_IPV6_NIB_6LN
# define CONFIG_GNRC_IPV6_NIB_6LN 1
# endif
/* We are only a 6lo node with no 'classic' IPv6 interface */
# ifndef MODULE_GNRC_IPV6_CLASSIC
/* We are only a 6lo node with no 'classic' IPv6 interface */
# ifndef CONFIG_GNRC_IPV6_NIB_QUEUE_PKT
# define CONFIG_GNRC_IPV6_NIB_QUEUE_PKT 0
# endif
@ -131,6 +130,13 @@ extern "C" {
# define CONFIG_GNRC_IPV6_NIB_ADV_ROUTER 0
#endif
/**
* @brief enable periodic router solicitations
*/
#ifndef CONFIG_GNRC_IPV6_NIB_SOL_ROUTER
# define CONFIG_GNRC_IPV6_NIB_SOL_ROUTER 1
#endif
/**
* @brief Include a Route Information Option for subnets
* on other interfaces in normal Router Advertisements

View File

@ -105,11 +105,17 @@ static void _handle_rdnss_timeout(sock_udp_ep_t *dns_server);
static inline bool _should_search_rtr(const gnrc_netif_t *netif)
{
/* 6LBR interface does not send RS.
A non-advertising router sends RS or a 6LN that is advertising or not
/* RS are globally disabled */
if (!CONFIG_GNRC_IPV6_NIB_SOL_ROUTER) {
return false;
}
/* 6LBR interface does not send RS. */
if (gnrc_netif_is_6lbr(netif)) {
return false;
}
/* A non-advertising router sends RS or a 6LN that is advertising or not
has to refetch router information */
return !gnrc_netif_is_6lbr(netif) &&
(!gnrc_netif_is_rtr_adv(netif) || gnrc_netif_is_6ln(netif));
return !gnrc_netif_is_rtr_adv(netif) || gnrc_netif_is_6ln(netif);
}
void gnrc_ipv6_nib_init(void)