Skip to content

Commit

Permalink
Merge pull request #4340 from cgundogan/pr/ndp/pio
Browse files Browse the repository at this point in the history
ndp: minor enhancements
  • Loading branch information
miri64 committed Jan 26, 2016
2 parents d46cd6e + 8d1f91f commit 60e5974
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions sys/net/gnrc/network_layer/ndp/internal/gnrc_ndp_internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -748,13 +748,16 @@ bool gnrc_ndp_internal_pi_opt_handle(kernel_pid_t iface, uint8_t icmpv6_type,
if (((prefix == NULL) ||
(gnrc_ipv6_netif_addr_get(prefix)->prefix_len != pi_opt->prefix_len)) &&
(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],
sizeof(eui64_t)) < 0)) {
DEBUG("ndp: could not get IID from interface %d\n", iface);
return false;
if (pi_opt->flags & NDP_OPT_PI_FLAGS_A) {
if ((gnrc_netapi_get(iface, NETOPT_IPV6_IID, 0, &pref_addr.u64[1],
sizeof(eui64_t)) < 0)) {
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);
prefix = gnrc_ipv6_netif_add_addr(iface, &pref_addr,
pi_opt->prefix_len,
Expand Down

0 comments on commit 60e5974

Please sign in to comment.