Skip to content
Snippets Groups Projects
Commit e32b1cca authored by Lotte Steenbrink's avatar Lotte Steenbrink
Browse files

Merge pull request #2975 from authmillenon/ipv6_nc/enh/opt2

ipv6_nc: Make interface optional
parents 46a3e8ac 343bec55
No related branches found
No related tags found
No related merge requests found
......@@ -152,7 +152,6 @@ void ng_ipv6_nc_init(void);
* @brief Adds a neighbor to the neighbor cache
*
* @param[in] iface PID to the interface where the neighbor is.
* Must not be KERNEL_PID_UNDEF.
* @param[in] ipv6_addr IPv6 address of the neighbor. Must not be NULL.
* @param[in] l2_addr Link layer address of the neighbor. NULL if unknown.
* @param[in] l2_addr_len Length of @p l2_addr, must be lesser than or equal
......
......@@ -51,8 +51,7 @@ ng_ipv6_nc_t *ng_ipv6_nc_add(kernel_pid_t iface, const ng_ipv6_addr_t *ipv6_addr
return NULL;
}
if ((l2_addr_len > NG_IPV6_NC_L2_ADDR_MAX) || (iface == KERNEL_PID_UNDEF) ||
ng_ipv6_addr_is_unspecified(ipv6_addr)) {
if ((l2_addr_len > NG_IPV6_NC_L2_ADDR_MAX) || ng_ipv6_addr_is_unspecified(ipv6_addr)) {
DEBUG("ipv6_nc: invalid parameters\n");
return NULL;
}
......
......@@ -76,8 +76,8 @@ static void test_ipv6_nc_add__iface_KERNEL_PID_UNDEF(void)
{
ng_ipv6_addr_t addr = DEFAULT_TEST_IPV6_ADDR;
TEST_ASSERT_NULL(ng_ipv6_nc_add(KERNEL_PID_UNDEF, &addr, TEST_STRING4,
sizeof(TEST_STRING4), 0));
TEST_ASSERT_NOT_NULL(ng_ipv6_nc_add(KERNEL_PID_UNDEF, &addr, TEST_STRING4,
sizeof(TEST_STRING4), 0));
}
static void test_ipv6_nc_add__addr_unspecified(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment