1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #3831 from cgundogan/pr/ndp/pio_prefix_len

ndp: assertify pio prefix len check and include 0 and 128
This commit is contained in:
Martine Lenders 2015-09-12 16:06:41 +02:00
commit 609867000e

View File

@ -346,8 +346,9 @@ void gnrc_ndp_internal_send_rtr_sol(kernel_pid_t iface, ipv6_addr_t *dst)
static bool _pio_from_iface_addr(gnrc_pktsnip_t **res, gnrc_ipv6_netif_addr_t *addr,
gnrc_pktsnip_t *next)
{
if (((addr->prefix_len - 1U) < 127U) && /* 0 < prefix_len < 128 */
!ipv6_addr_is_unspecified(&addr->addr) &&
assert(((uint8_t) addr->prefix_len) <= 128U);
if (!ipv6_addr_is_unspecified(&addr->addr) &&
!ipv6_addr_is_link_local(&addr->addr) &&
!gnrc_ipv6_netif_addr_is_non_unicast(&addr->addr)) {
DEBUG(" - PIO for %s/%" PRIu8 "\n", ipv6_addr_to_str(addr_str, &addr->addr,