gnrc/nib: Move GNRC_IPV6_NIB_CONF_MULTIHOP_DAD to 'CONFIG_' namespace

Also evaluate using IS_ACTIVE macro.
This commit is contained in:
Leandro Lanzieri 2020-03-12 16:14:26 +01:00
parent 3ec296400d
commit 22b4df9537
No known key found for this signature in database
GPG Key ID: 39607DE6080007A3
4 changed files with 10 additions and 10 deletions

View File

@ -208,8 +208,8 @@ extern "C" {
*
* @see [RFC 6775, section 8.2](https://tools.ietf.org/html/rfc6775#section-8.2)
*/
#ifndef GNRC_IPV6_NIB_CONF_MULTIHOP_DAD
#define GNRC_IPV6_NIB_CONF_MULTIHOP_DAD 0
#ifndef CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD
#define CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD 0
#endif
/** @} */

View File

@ -62,9 +62,9 @@ uint8_t _reg_addr_upstream(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
aro->eui64.uint8[6], aro->eui64.uint8[7]);
if ((nce == NULL) || !(nce->mode & _NC) ||
(memcmp(&nce->eui64, &aro->eui64, sizeof(aro->eui64)) == 0)) {
#if GNRC_IPV6_NIB_CONF_MULTIHOP_DAD
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD)
/* TODO */
#endif /* GNRC_IPV6_NIB_CONF_MULTIHOP_DAD */
#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD */
if (aro->ltime.u16 != 0) {
_handle_sl2ao(netif, ipv6, icmpv6, sl2ao);
/* re-get NCE in case it was updated */
@ -112,12 +112,12 @@ gnrc_pktsnip_t *_copy_and_handle_aro(gnrc_netif_t *netif,
DEBUG("nib: No space left in packet buffer. Not replying NS");
}
}
#if GNRC_IPV6_NIB_CONF_MULTIHOP_DAD
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD)
else if (status != _ADDR_REG_STATUS_IGNORE) {
DEBUG("nib: Address was marked TENTATIVE => not replying NS, "
"waiting for DAC\n");
}
#endif /* GNRC_IPV6_NIB_CONF_MULTIHOP_DAD */
#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD */
}
return reply_aro;
}

View File

@ -121,7 +121,7 @@ void _handle_sl2ao(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
if (icmpv6->type == ICMPV6_NBR_SOL) {
nce->info &= ~GNRC_IPV6_NIB_NC_INFO_IS_ROUTER;
}
#if GNRC_IPV6_NIB_CONF_MULTIHOP_DAD && IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LR)
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD) && IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_6LR)
else if (_rtr_sol_on_6lr(netif, icmpv6)) {
DEBUG("nib: Setting newly created entry to tentative\n");
_set_ar_state(nce, GNRC_IPV6_NIB_NC_INFO_AR_STATE_TENTATIVE);
@ -129,7 +129,7 @@ void _handle_sl2ao(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
&nce->addr_reg_timeout,
SIXLOWPAN_ND_TENTATIVE_NCE_SEC_LTIME * MS_PER_SEC);
}
#endif /* GNRC_IPV6_NIB_CONF_MULTIHOP_DAD && CONFIG_GNRC_IPV6_NIB_6LR */
#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD && CONFIG_GNRC_IPV6_NIB_6LR */
}
#if ENABLE_DEBUG
else {

View File

@ -312,14 +312,14 @@ void gnrc_ipv6_nib_handle_pkt(gnrc_netif_t *netif, const ipv6_hdr_t *ipv6,
/* TODO */
break;
#endif /* CONFIG_GNRC_IPV6_NIB_REDIRECT */
#if GNRC_IPV6_NIB_CONF_MULTIHOP_DAD
#if IS_ACTIVE(CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD)
case ICMPV6_DAR:
/* TODO */
break;
case ICMPV6_DAC:
/* TODO */
break;
#endif /* GNRC_IPV6_NIB_CONF_MULTIHOP_DAD */
#endif /* CONFIG_GNRC_IPV6_NIB_MULTIHOP_DAD */
}
_nib_release();
gnrc_netif_release(netif);