Skip to content

Commit

Permalink
Merge #19920
Browse files Browse the repository at this point in the history
19920: gnrc_ipv6_nib: disable router advertisements on interface startup r=miri64 a=benpicco





Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
  • Loading branch information
bors[bot] and benpicco authored Sep 13, 2023
2 parents f32b661 + c337992 commit d9367b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
9 changes: 1 addition & 8 deletions sys/include/net/gnrc/ipv6/nib/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,11 @@ extern "C" {
#endif

/**
* @brief (de-)activate router advertising at interface start-up
* @brief activate router advertising at interface start-up
*/
#ifndef CONFIG_GNRC_IPV6_NIB_ADV_ROUTER
#if CONFIG_GNRC_IPV6_NIB_ROUTER && \
(!CONFIG_GNRC_IPV6_NIB_6LR || CONFIG_GNRC_IPV6_NIB_6LBR) && \
!(IS_USED(MODULE_DHCPV6_CLIENT_IA_PD) || IS_USED(MODULE_GNRC_UHCPC) || \
IS_USED(MODULE_GNRC_IPV6_AUTO_SUBNETS) || IS_USED(MODULE_GNRC_IPV6_STATIC_ADDR))
#define CONFIG_GNRC_IPV6_NIB_ADV_ROUTER 1
#else
#define CONFIG_GNRC_IPV6_NIB_ADV_ROUTER 0
#endif
#endif

/**
* @brief Include a Route Information Option for subnets
Expand Down
9 changes: 7 additions & 2 deletions sys/net/gnrc/routing/rpl/gnrc_rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,15 @@ kernel_pid_t gnrc_rpl_init(kernel_pid_t if_pid)
}

/* register all_RPL_nodes multicast address */
gnrc_netif_ipv6_group_join_internal(gnrc_netif_get_by_pid(if_pid),
&ipv6_addr_all_rpl_nodes);
gnrc_netif_t *netif = gnrc_netif_get_by_pid(if_pid);
gnrc_netif_ipv6_group_join_internal(netif, &ipv6_addr_all_rpl_nodes);

/* send DODAG Information Solicitation */
gnrc_rpl_send_DIS(NULL, (ipv6_addr_t *) &ipv6_addr_all_rpl_nodes, NULL, 0);

/* RPL enables routing, start advertising ourself as a router */
gnrc_ipv6_nib_change_rtr_adv_iface(netif, true);

return gnrc_rpl_pid;
}

Expand Down

0 comments on commit d9367b1

Please # to comment.