From b28a58670263b7be8bc02cd3baff53e70d7b4769 Mon Sep 17 00:00:00 2001 From: PeterKietzmann Date: Wed, 8 Jan 2020 10:57:19 +0100 Subject: [PATCH] net/gnrc/netif: Move GNRC_NETIF_DEFAULT_HL to 'CONFIG_' namespace --- sys/include/net/gnrc/netif/conf.h | 4 ++-- sys/net/gnrc/netif/gnrc_netif.c | 2 +- sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c | 2 +- tests/gnrc_ipv6_ext_frag/main.c | 2 +- tests/gnrc_ipv6_nib/main.c | 2 +- tests/gnrc_ipv6_nib_6ln/main.c | 2 +- tests/gnrc_netif/main.c | 6 +++--- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/sys/include/net/gnrc/netif/conf.h b/sys/include/net/gnrc/netif/conf.h index 386fe80676..bfed01e904 100644 --- a/sys/include/net/gnrc/netif/conf.h +++ b/sys/include/net/gnrc/netif/conf.h @@ -133,8 +133,8 @@ extern "C" { #endif #endif -#ifndef GNRC_NETIF_DEFAULT_HL -#define GNRC_NETIF_DEFAULT_HL (64U) /**< default hop limit */ +#ifndef CONFIG_GNRC_NETIF_DEFAULT_HL +#define CONFIG_GNRC_NETIF_DEFAULT_HL (64U) /**< default hop limit */ #endif /** diff --git a/sys/net/gnrc/netif/gnrc_netif.c b/sys/net/gnrc/netif/gnrc_netif.c index d3b86775a8..ec499fde7b 100644 --- a/sys/net/gnrc/netif/gnrc_netif.c +++ b/sys/net/gnrc/netif/gnrc_netif.c @@ -1329,7 +1329,7 @@ void gnrc_netif_default_init(gnrc_netif_t *netif) #ifdef DEVELHELP _test_options(netif); #endif - netif->cur_hl = GNRC_NETIF_DEFAULT_HL; + netif->cur_hl = CONFIG_GNRC_NETIF_DEFAULT_HL; #ifdef MODULE_GNRC_IPV6_NIB gnrc_ipv6_nib_init_iface(netif); #endif diff --git a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c index aafa28f6c3..1fc45cb07f 100644 --- a/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c +++ b/sys/net/gnrc/network_layer/ipv6/gnrc_ipv6.c @@ -354,7 +354,7 @@ static int _fill_ipv6_hdr(gnrc_netif_t *netif, gnrc_pktsnip_t *ipv6) if (hdr->hl == 0) { if (netif == NULL) { - hdr->hl = GNRC_NETIF_DEFAULT_HL; + hdr->hl = CONFIG_GNRC_NETIF_DEFAULT_HL; } else { hdr->hl = netif->cur_hl; diff --git a/tests/gnrc_ipv6_ext_frag/main.c b/tests/gnrc_ipv6_ext_frag/main.c index c1fe8ac956..2f0f69ebac 100644 --- a/tests/gnrc_ipv6_ext_frag/main.c +++ b/tests/gnrc_ipv6_ext_frag/main.c @@ -542,7 +542,7 @@ static gnrc_pktsnip_t *_build_udp_packet(const ipv6_addr_t *dst, ipv6_hdr = hdr->data; ipv6_hdr->len = byteorder_htons(gnrc_pkt_len(payload)); ipv6_hdr->nh = PROTNUM_UDP; - ipv6_hdr->hl = GNRC_NETIF_DEFAULT_HL; + ipv6_hdr->hl = CONFIG_GNRC_NETIF_DEFAULT_HL; gnrc_udp_calc_csum(payload, hdr); payload = hdr; hdr = gnrc_netif_hdr_build(NULL, 0, NULL, 0); diff --git a/tests/gnrc_ipv6_nib/main.c b/tests/gnrc_ipv6_nib/main.c index d16b2d16ca..103228b08a 100644 --- a/tests/gnrc_ipv6_nib/main.c +++ b/tests/gnrc_ipv6_nib/main.c @@ -78,7 +78,7 @@ static void _set_up(void) gnrc_netif_acquire(_mock_netif); /* reset some fields not set by the nib interface initializer */ _mock_netif->ipv6.mtu = ETHERNET_DATA_LEN; - _mock_netif->cur_hl = GNRC_NETIF_DEFAULT_HL; + _mock_netif->cur_hl = CONFIG_GNRC_NETIF_DEFAULT_HL; gnrc_netif_ipv6_addr_remove_internal(_mock_netif, &_loc_gb); gnrc_netif_release(_mock_netif); memset(_buffer, 0, sizeof(_buffer)); diff --git a/tests/gnrc_ipv6_nib_6ln/main.c b/tests/gnrc_ipv6_nib_6ln/main.c index 01ddc2da53..c951765d69 100644 --- a/tests/gnrc_ipv6_nib_6ln/main.c +++ b/tests/gnrc_ipv6_nib_6ln/main.c @@ -87,7 +87,7 @@ static void _set_up(void) gnrc_netif_acquire(_mock_netif); /* reset some fields not set by the nib interface initializer */ _mock_netif->ipv6.mtu = IPV6_MIN_MTU; - _mock_netif->cur_hl = GNRC_NETIF_DEFAULT_HL; + _mock_netif->cur_hl = CONFIG_GNRC_NETIF_DEFAULT_HL; gnrc_netif_ipv6_addr_remove_internal(_mock_netif, &_loc_gb); gnrc_netif_release(_mock_netif); memset(_buffer, 0, sizeof(_buffer)); diff --git a/tests/gnrc_netif/main.c b/tests/gnrc_netif/main.c index 7d04dc6311..740ab562db 100644 --- a/tests/gnrc_netif/main.c +++ b/tests/gnrc_netif/main.c @@ -126,7 +126,7 @@ static void test_creation(void) TEST_ASSERT_NOT_NULL(ethernet_netif->ops); TEST_ASSERT_NOT_NULL(ethernet_netif->dev); TEST_ASSERT_EQUAL_INT(ETHERNET_DATA_LEN, ethernet_netif->ipv6.mtu); - TEST_ASSERT_EQUAL_INT(GNRC_NETIF_DEFAULT_HL, ethernet_netif->cur_hl); + TEST_ASSERT_EQUAL_INT(CONFIG_GNRC_NETIF_DEFAULT_HL, ethernet_netif->cur_hl); TEST_ASSERT_EQUAL_INT(NETDEV_TYPE_ETHERNET, ethernet_netif->device_type); TEST_ASSERT(ethernet_netif->pid > KERNEL_PID_UNDEF); #ifdef DEVELHELP @@ -147,7 +147,7 @@ static void test_creation(void) TEST_ASSERT_EQUAL_INT(IPV6_MIN_MTU, ieee802154_netif->ipv6.mtu); TEST_ASSERT_EQUAL_INT(TEST_IEEE802154_MAX_FRAG_SIZE, ieee802154_netif->sixlo.max_frag_size); - TEST_ASSERT_EQUAL_INT(GNRC_NETIF_DEFAULT_HL, ieee802154_netif->cur_hl); + TEST_ASSERT_EQUAL_INT(CONFIG_GNRC_NETIF_DEFAULT_HL, ieee802154_netif->cur_hl); TEST_ASSERT_EQUAL_INT(NETDEV_TYPE_IEEE802154, ieee802154_netif->device_type); TEST_ASSERT(ieee802154_netif->pid > KERNEL_PID_UNDEF); @@ -163,7 +163,7 @@ static void test_creation(void) ))); TEST_ASSERT_NOT_NULL(netifs[i]->ops); TEST_ASSERT_NOT_NULL(netifs[i]->dev); - TEST_ASSERT_EQUAL_INT(GNRC_NETIF_DEFAULT_HL, netifs[i]->cur_hl); + TEST_ASSERT_EQUAL_INT(CONFIG_GNRC_NETIF_DEFAULT_HL, netifs[i]->cur_hl); TEST_ASSERT_EQUAL_INT(NETDEV_TYPE_TEST, netifs[i]->device_type); TEST_ASSERT(netifs[i]->pid > KERNEL_PID_UNDEF); TEST_ASSERT(thread_has_msg_queue(sched_threads[netifs[i]->pid]));