From 8da519669b528fc425987692e8ae4c0c602d02b3 Mon Sep 17 00:00:00 2001 From: xnumad <34810600+xnumad@users.noreply.github.com> Date: Thu, 22 Feb 2024 13:42:35 +0100 Subject: [PATCH] refactor: Make called function inline --- sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c | 14 +++++++++----- sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.h | 6 +++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c index b27fcd51ca10f..f586fee8e6522 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c @@ -15,8 +15,8 @@ #include #include -#if IS_ACTIVE(CONFIG_GNRC_IPV6_STABLE_PRIVACY) #include "_nib-slaac.h" +#if IS_ACTIVE(CONFIG_GNRC_IPV6_STABLE_PRIVACY) #include #include "ztimer.h" #include "random.h" @@ -36,19 +36,23 @@ #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN) || IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_SLAAC) static char addr_str[IPV6_ADDR_MAX_STR_LEN]; -#if !IS_ACTIVE(CONFIG_GNRC_IPV6_STABLE_PRIVACY) -void _auto_configure_addr(gnrc_netif_t *netif, const ipv6_addr_t *pfx, - uint8_t pfx_len) -#else inline void _auto_configure_addr(gnrc_netif_t *netif, const ipv6_addr_t *pfx, uint8_t pfx_len) { +#if !IS_ACTIVE(CONFIG_GNRC_IPV6_STABLE_PRIVACY) + _auto_configure_addr_default(netif, pfx, pfx_len); +#else _auto_configure_addr_with_dad_ctr(netif, pfx, pfx_len, 0); +#endif } +#if IS_ACTIVE(CONFIG_GNRC_IPV6_STABLE_PRIVACY) void _auto_configure_addr_with_dad_ctr(gnrc_netif_t *netif, const ipv6_addr_t *pfx, uint8_t pfx_len, uint8_t dad_ctr) +#else +void _auto_configure_addr_default(gnrc_netif_t *netif, + const ipv6_addr_t *pfx, uint8_t pfx_len) #endif { ipv6_addr_t addr = IPV6_ADDR_UNSPECIFIED; diff --git a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.h b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.h index ece69f580c2a7..979fcb7a089cb 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.h +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.h @@ -91,13 +91,17 @@ extern "C" { */ void _auto_configure_addr(gnrc_netif_t *netif, const ipv6_addr_t *pfx, uint8_t pfx_len); -#if IS_ACTIVE(CONFIG_GNRC_IPV6_STABLE_PRIVACY) || defined(DOXYGEN) + +#if IS_ACTIVE(CONFIG_GNRC_IPV6_STABLE_PRIVACY) /** * @brief Overload of @ref _auto_configure_addr * @param dad_ctr rfc7217 DAD_Counter */ void _auto_configure_addr_with_dad_ctr(gnrc_netif_t *netif, const ipv6_addr_t *pfx, uint8_t pfx_len, uint8_t dad_ctr); +#else +void _auto_configure_addr_default(gnrc_netif_t *netif, const ipv6_addr_t *pfx, + uint8_t pfx_len); #endif #else /* CONFIG_GNRC_IPV6_NIB_6LN || CONFIG_GNRC_IPV6_NIB_SLAAC */