From cb68c01325e191543e5f118882779617c0924b80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= Date: Sat, 30 Jan 2016 13:47:04 +0100 Subject: [PATCH 1/2] ipv6/nc: doc fix and removed unused macro --- sys/include/net/gnrc/ipv6/nc.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/include/net/gnrc/ipv6/nc.h b/sys/include/net/gnrc/ipv6/nc.h index 617d5962584c..babc73822f44 100644 --- a/sys/include/net/gnrc/ipv6/nc.h +++ b/sys/include/net/gnrc/ipv6/nc.h @@ -88,7 +88,6 @@ extern "C" { #define GNRC_IPV6_NC_IS_ROUTER (0x08) /**< The neighbor is a router */ #define GNRC_IPV6_NC_TYPE_MASK (0x30) /**< Mask for neighbor cache state */ -#define GNRC_IPV6_NC_TYPE_POS (4) /**< Shift of neighbor cache state */ /** * @{ @@ -232,7 +231,7 @@ gnrc_ipv6_nc_t *gnrc_ipv6_nc_get_next(gnrc_ipv6_nc_t *prev); gnrc_ipv6_nc_t *gnrc_ipv6_nc_get_next_router(gnrc_ipv6_nc_t *prev); /** - * @brief Returns the state of a neigbor cache entry. + * @brief Returns the state of a neighbor cache entry. * * @param[in] entry A neighbor cache entry * @@ -244,7 +243,7 @@ static inline uint8_t gnrc_ipv6_nc_get_state(const gnrc_ipv6_nc_t *entry) } /** - * @brief Returns the type of a neigbor cache entry. + * @brief Returns the type of a neighbor cache entry. * * @param[in] entry A neighbor cache entry * From e0bf46ce6068b8b58dc1a7b8138f3f63fa3c6087 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cenk=20G=C3=BCndo=C4=9Fan?= Date: Sat, 30 Jan 2016 15:25:37 +0100 Subject: [PATCH 2/2] unittests: nc: test reachability of unmanaged entries --- tests/unittests/tests-ipv6_nc/tests-ipv6_nc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/unittests/tests-ipv6_nc/tests-ipv6_nc.c b/tests/unittests/tests-ipv6_nc/tests-ipv6_nc.c index 59ed7909dad7..00c35c46c2c6 100644 --- a/tests/unittests/tests-ipv6_nc/tests-ipv6_nc.c +++ b/tests/unittests/tests-ipv6_nc/tests-ipv6_nc.c @@ -345,6 +345,18 @@ static void test_ipv6_nc_is_reachable__reachable(void) TEST_ASSERT(gnrc_ipv6_nc_is_reachable(entry)); } +static void test_ipv6_nc_is_reachable__unmanaged(void) +{ + ipv6_addr_t addr = DEFAULT_TEST_IPV6_ADDR; + gnrc_ipv6_nc_t *entry = NULL; + + test_ipv6_nc_add__success(); /* adds DEFAULT_TEST_IPV6_ADDR to DEFAULT_TEST_NETIF */ + + TEST_ASSERT_NOT_NULL((entry = gnrc_ipv6_nc_get(DEFAULT_TEST_NETIF, &addr))); + entry->flags = (GNRC_IPV6_NC_STATE_UNMANAGED << GNRC_IPV6_NC_STATE_POS); + TEST_ASSERT(gnrc_ipv6_nc_is_reachable(entry)); +} + static void test_ipv6_nc_still_reachable__incomplete(void) { ipv6_addr_t addr = DEFAULT_TEST_IPV6_ADDR; @@ -449,6 +461,7 @@ Test *tests_ipv6_nc_tests(void) new_TestFixture(test_ipv6_nc_get_next_router__second_entry), new_TestFixture(test_ipv6_nc_is_reachable__incomplete), new_TestFixture(test_ipv6_nc_is_reachable__reachable), + new_TestFixture(test_ipv6_nc_is_reachable__unmanaged), new_TestFixture(test_ipv6_nc_still_reachable__incomplete), new_TestFixture(test_ipv6_nc_still_reachable__success), new_TestFixture(test_ipv6_nc_get_l2_addr__NULL_entry),