Merge pull request #2975 from authmillenon/ipv6_nc/enh/opt2
ipv6_nc: Make interface optional
This commit is contained in:
commit
e32b1cca16
@ -152,7 +152,6 @@ void ng_ipv6_nc_init(void);
|
|||||||
* @brief Adds a neighbor to the neighbor cache
|
* @brief Adds a neighbor to the neighbor cache
|
||||||
*
|
*
|
||||||
* @param[in] iface PID to the interface where the neighbor is.
|
* @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] 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 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
|
* @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;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((l2_addr_len > NG_IPV6_NC_L2_ADDR_MAX) || (iface == KERNEL_PID_UNDEF) ||
|
if ((l2_addr_len > NG_IPV6_NC_L2_ADDR_MAX) || ng_ipv6_addr_is_unspecified(ipv6_addr)) {
|
||||||
ng_ipv6_addr_is_unspecified(ipv6_addr)) {
|
|
||||||
DEBUG("ipv6_nc: invalid parameters\n");
|
DEBUG("ipv6_nc: invalid parameters\n");
|
||||||
return NULL;
|
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;
|
ng_ipv6_addr_t addr = DEFAULT_TEST_IPV6_ADDR;
|
||||||
|
|
||||||
TEST_ASSERT_NULL(ng_ipv6_nc_add(KERNEL_PID_UNDEF, &addr, TEST_STRING4,
|
TEST_ASSERT_NOT_NULL(ng_ipv6_nc_add(KERNEL_PID_UNDEF, &addr, TEST_STRING4,
|
||||||
sizeof(TEST_STRING4), 0));
|
sizeof(TEST_STRING4), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_ipv6_nc_add__addr_unspecified(void)
|
static void test_ipv6_nc_add__addr_unspecified(void)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user