diff options
Diffstat (limited to 'accel-pppd/ipv6/dhcpv6.c')
-rw-r--r-- | accel-pppd/ipv6/dhcpv6.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c index 62f20bb..3f9df71 100644 --- a/accel-pppd/ipv6/dhcpv6.c +++ b/accel-pppd/ipv6/dhcpv6.c @@ -21,11 +21,12 @@ #include "ppp.h" #include "ipdb.h" #include "events.h" - -#include "memdebug.h" +#include "iputils.h" #include "dhcpv6.h" +#include "memdebug.h" + #define BUF_SIZE 65536 #define MAX_DNS_COUNT 3 @@ -295,6 +296,18 @@ static void dhcpv6_send_reply(struct dhcpv6_packet *req, struct dhcpv6_pd *pd, i ia_addr->pref_lifetime = htonl(conf_pref_lifetime); ia_addr->valid_lifetime = htonl(conf_valid_lifetime); + + if (a->installed) { + if (a->prefix_len > 64) + ip6route_add(ses->ifindex, &a->addr, a->prefix_len, 0); + else { + struct in6_addr addr; + memcpy(addr.s6_addr, &a->addr, 8); + memcpy(addr.s6_addr + 8, &ses->ipv6->intf_id, 8); + ip6addr_add(ses->ifindex, &addr, a->prefix_len); + } + a->installed = 1; + } } list_for_each_entry(opt2, &opt->opt_list, entry) { |