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

ndp: check for A flag in received PIO

This commit is contained in:
test 2015-11-25 00:10:44 +01:00 committed by Cenk Gündoğan
parent c8839b71d8
commit 8d1f91f128

View File

@ -748,13 +748,16 @@ bool gnrc_ndp_internal_pi_opt_handle(kernel_pid_t iface, uint8_t icmpv6_type,
if (((prefix == NULL) || if (((prefix == NULL) ||
(gnrc_ipv6_netif_addr_get(prefix)->prefix_len != pi_opt->prefix_len)) && (gnrc_ipv6_netif_addr_get(prefix)->prefix_len != pi_opt->prefix_len)) &&
(pi_opt->valid_ltime.u32 != 0)) { (pi_opt->valid_ltime.u32 != 0)) {
ipv6_addr_t pref_addr; ipv6_addr_t pref_addr = IPV6_ADDR_UNSPECIFIED;
if ((gnrc_netapi_get(iface, NETOPT_IPV6_IID, 0, &pref_addr.u64[1], if (pi_opt->flags & NDP_OPT_PI_FLAGS_A) {
sizeof(eui64_t)) < 0)) { if ((gnrc_netapi_get(iface, NETOPT_IPV6_IID, 0, &pref_addr.u64[1],
DEBUG("ndp: could not get IID from interface %d\n", iface); sizeof(eui64_t)) < 0)) {
return false; DEBUG("ndp: could not get IID from interface %d\n", iface);
return false;
}
} }
ipv6_addr_init_prefix(&pref_addr, &pi_opt->prefix, pi_opt->prefix_len); ipv6_addr_init_prefix(&pref_addr, &pi_opt->prefix, pi_opt->prefix_len);
prefix = gnrc_ipv6_netif_add_addr(iface, &pref_addr, prefix = gnrc_ipv6_netif_add_addr(iface, &pref_addr,
pi_opt->prefix_len, pi_opt->prefix_len,