diff options
author | xebd <xeb@mail.ru> | 2018-01-13 15:24:04 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-13 15:24:04 +0300 |
commit | 28d4f7446c7e8e901109d1d90928c09b9ee4d49d (patch) | |
tree | d884d23c46fffc52247bce87781a9f8656a1ff82 /accel-pppd/extra | |
parent | e25f03bf144dbe7121bc5710aafbd45f71215436 (diff) | |
parent | abaa43a307fa7a790dd34034c5fd8013dbd0488c (diff) | |
download | accel-ppp-28d4f7446c7e8e901109d1d90928c09b9ee4d49d.tar.gz accel-ppp-28d4f7446c7e8e901109d1d90928c09b9ee4d49d.zip |
Merge pull request #35 from themiron/ipv6-pool-fixes
Ipv6 pool fixes
Diffstat (limited to 'accel-pppd/extra')
-rw-r--r-- | accel-pppd/extra/pppd_compat.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c index ce7e7550..8a4f3ac9 100644 --- a/accel-pppd/extra/pppd_compat.c +++ b/accel-pppd/extra/pppd_compat.c @@ -578,16 +578,6 @@ static void fill_argv(char **argv, struct pppd_compat_pd *pd, char *path) argv[7] = NULL; } -static void build_addr(struct ipv6db_addr_t *a, uint64_t intf_id, struct in6_addr *addr) -{ - memcpy(addr, &a->addr, sizeof(*addr)); - - if (a->prefix_len <= 64) - *(uint64_t *)(addr->s6_addr + 8) = intf_id; - else - *(uint64_t *)(addr->s6_addr + 8) |= intf_id & htobe64((1 << (128 - a->prefix_len)) - 1); -} - static void fill_env(char **env, char *mem, struct pppd_compat_pd *pd) { struct ap_session *ses = pd->ses; @@ -628,7 +618,7 @@ static void fill_env(char **env, char *mem, struct pppd_compat_pd *pd) char ip6_buf[INET6_ADDRSTRLEN]; struct in6_addr addr; - build_addr(a, ses->ipv6->peer_intf_id, &addr); + build_ip6_addr(a, ses->ipv6->peer_intf_id, &addr); env[n] = mem; write_sz = snprintf(mem, mem_sz, "IPV6_PREFIX=%s/%i", |