diff --git a/sys/include/net/gnrc/netif/flags.h b/sys/include/net/gnrc/netif/flags.h index d269fdda70..2d02e80cc3 100644 --- a/sys/include/net/gnrc/netif/flags.h +++ b/sys/include/net/gnrc/netif/flags.h @@ -27,9 +27,9 @@ extern "C" { * @anchor net_gnrc_netif_aac */ enum { - GNRC_NETIF_AAC_NONE = 0, /**< no configuration */ - GNRC_NETIF_AAC_AUTO, /**< Use some automatic bootstrapping (e.g. SLAAC with IPv6) */ - GNRC_NETIF_AAC_DHCP, /**< Use DHCP(v6) */ + GNRC_NETIF_AAC_NONE = 0x00, /**< no configuration */ + GNRC_NETIF_AAC_AUTO = 0x01, /**< Use some automatic bootstrapping (e.g. SLAAC with IPv6) */ + GNRC_NETIF_AAC_DHCP = 0x02, /**< Use DHCP(v6) */ /* extend if needed */ }; @@ -82,7 +82,7 @@ enum { #define GNRC_NETIF_FLAGS_IPV6_ADV_RETRANS_TIMER (0x00000040U) /** - * @brief If gnrc_netif_t::ipv6::aac_mode == GNRC_NETIF_AAC_DHCP then this + * @brief If gnrc_netif_t::ipv6::aac_mode & GNRC_NETIF_AAC_DHCP then this * flag indicates that other configuration information is available via * DHCPv6 (e.g. DNS-related information) * diff --git a/sys/include/net/gnrc/netif/ipv6.h b/sys/include/net/gnrc/netif/ipv6.h index 5fb6acbada..8bd2ec0ca2 100644 --- a/sys/include/net/gnrc/netif/ipv6.h +++ b/sys/include/net/gnrc/netif/ipv6.h @@ -243,7 +243,7 @@ typedef struct { #endif /* MODULE_GNRC_IPV6_NIB */ /** - * @brief IPv6 auto-address configuration mode + * @brief IPv6 auto-address configuration mode flags * * @note Only available with module @ref net_gnrc_ipv6 "gnrc_ipv6" */ 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 1771eb119f..46bfb3a0cb 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/_nib-slaac.c @@ -163,7 +163,7 @@ void _remove_tentative_addr(gnrc_netif_t *netif, const ipv6_addr_t *addr) * not change hardware address to retry SLAAC => use purely * DHCPv6 instead */ /* TODO: implement IA_NA for DHCPv6 */ - /* then => tgt_netif->aac_mode = GNRC_NETIF_AAC_DHCP; */ + /* then => tgt_netif->aac_mode |= GNRC_NETIF_AAC_DHCP; */ DEBUG("nib: would set interface %i to DHCPv6, " "but is not implemented yet", netif->pid); } diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib.c b/sys/net/gnrc/network_layer/ipv6/nib/nib.c index d95502be62..32d66276d1 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/nib.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/nib.c @@ -133,7 +133,7 @@ void gnrc_ipv6_nib_init_iface(gnrc_netif_t *netif) #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_SLAAC) || IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LN) /* TODO: set differently dependent on CONFIG_GNRC_IPV6_NIB_SLAAC if * alternatives exist */ - netif->ipv6.aac_mode = GNRC_NETIF_AAC_AUTO; + netif->ipv6.aac_mode |= GNRC_NETIF_AAC_AUTO; #endif /* CONFIG_GNRC_IPV6_NIB_SLAAC || CONFIG_GNRC_IPV6_NIB_6LN */ _init_iface_router(netif); gnrc_netif_init_6ln(netif); diff --git a/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c b/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c index 6ddd8c94fa..054c90ead1 100644 --- a/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c +++ b/sys/net/gnrc/network_layer/ipv6/nib/nib_pl.c @@ -69,7 +69,7 @@ int gnrc_ipv6_nib_pl_set(unsigned iface, (ipv6_addr_match_prefix(&netif->ipv6.addrs[idx], pfx) >= pfx_len)) { dst->flags |= _PFX_ON_LINK; } - if (netif->ipv6.aac_mode == GNRC_NETIF_AAC_AUTO) { + if (netif->ipv6.aac_mode & GNRC_NETIF_AAC_AUTO) { dst->flags |= _PFX_SLAAC; } #if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LBR) && IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_P6C) diff --git a/sys/net/gnrc/network_layer/ndp/gnrc_ndp.c b/sys/net/gnrc/network_layer/ndp/gnrc_ndp.c index 2fc4d16437..71ce011e65 100644 --- a/sys/net/gnrc/network_layer/ndp/gnrc_ndp.c +++ b/sys/net/gnrc/network_layer/ndp/gnrc_ndp.c @@ -538,7 +538,7 @@ void gnrc_ndp_rtr_adv_send(gnrc_netif_t *netif, const ipv6_addr_t *src, if (!fin) { adv_ltime = netif->ipv6.rtr_ltime; } - if (netif->ipv6.aac_mode == GNRC_NETIF_AAC_DHCP) { + if (netif->ipv6.aac_mode & GNRC_NETIF_AAC_DHCP) { flags |= NDP_RTR_ADV_FLAGS_M; if (netif->flags & GNRC_NETIF_FLAGS_IPV6_ADV_O_FLAG) { flags |= NDP_RTR_ADV_FLAGS_O;