X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/b3f40f41f7de7a383c6f1170e546d0b09cc57338..refs/heads/samesversion:/icmp.c?ds=sidebyside diff --git a/icmp.c b/icmp.c index 0d6c65e..d03b60b 100644 --- a/icmp.c +++ b/icmp.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "dhcp6.h" @@ -143,7 +144,13 @@ void send_ipv6_ra(sessionidt s, tunnelidt t, struct in6_addr *ip) pinfo->nd_opt_pi_preferred_time = htonl(604800); pinfo->nd_opt_pi_reserved2 = 0; pinfo->nd_opt_pi_prefix_len = 64; // prefix length - pinfo->nd_opt_pi_prefix = config->ipv6_prefix; + if (session[s].ipv6address.s6_addr[0]) + { + // MSB 64bits of assigned IPv6 address to user (see radius attribut Framed-IPv6-Address) + memcpy(&pinfo->nd_opt_pi_prefix, &session[s].ipv6address.s6_addr[0], 8); + } + else + pinfo->nd_opt_pi_prefix = config->ipv6_prefix; // // Length of payload (not header) p_ip6_hdr->ip6_plen = htons(sizeof(*pinfo) + sizeof(*p_nra));