diff options
Diffstat (limited to 'accel-pppd/ipv6/nd.c')
-rw-r--r-- | accel-pppd/ipv6/nd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/accel-pppd/ipv6/nd.c b/accel-pppd/ipv6/nd.c index a93724cd..4dd9d5a7 100644 --- a/accel-pppd/ipv6/nd.c +++ b/accel-pppd/ipv6/nd.c @@ -90,7 +90,6 @@ struct ipv6_nd_handler_t }; static void *pd_key; -static struct in6_addr null_addr; #define BUF_SIZE 1024 static mempool_t buf_pool; @@ -154,8 +153,10 @@ static void ipv6_nd_send_ra(struct ipv6_nd_handler_t *h, struct sockaddr_in6 *ds memcpy(peer_addr.s6_addr + 8, &ses->ipv6->peer_intf_id, 8); ip6addr_add_peer(ses->ifindex, &addr, &peer_addr); } else { - memcpy(addr.s6_addr, &a->addr, 8); - memcpy(addr.s6_addr + 8, &ses->ipv6->intf_id, 8); + build_ip6_addr(a, ses->ipv6->intf_id, &addr); + build_ip6_addr(a, ses->ipv6->peer_intf_id, &peer_addr); + if (memcmp(&addr, &peer_addr, sizeof(addr)) == 0) + build_ip6_addr(a, ~ses->ipv6->intf_id, &addr); ip6addr_add(ses->ifindex, &addr, a->prefix_len); } a->installed = 1; @@ -383,7 +384,7 @@ static void ev_ses_started(struct ap_session *ses) return; list_for_each_entry(a, &ses->ipv6->addr_list, entry) { - if (a->prefix_len && memcmp(a->addr.s6_addr, null_addr.s6_addr, sizeof(null_addr))) { + if (a->prefix_len && !IN6_IS_ADDR_UNSPECIFIED(&a->addr)) { ipv6_nd_start(ses); break; } |