summaryrefslogtreecommitdiff
path: root/accel-pppd/ifcfg.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2018-01-13 15:24:21 +0300
committerDmitry Kozlov <xeb@mail.ru>2018-01-13 15:24:21 +0300
commit568d50a7b810349db9567622e37924d44ee22a2d (patch)
tree5465f10ca7453dbba0380a251dd034d53ca24670 /accel-pppd/ifcfg.c
parentc87ad75fde8531ebd947ae19a25eded8340b5828 (diff)
parent28d4f7446c7e8e901109d1d90928c09b9ee4d49d (diff)
downloadaccel-ppp-568d50a7b810349db9567622e37924d44ee22a2d.tar.gz
accel-ppp-568d50a7b810349db9567622e37924d44ee22a2d.zip
Merge branch 'master' of https://github.com/xebd/accel-ppp
Diffstat (limited to 'accel-pppd/ifcfg.c')
-rw-r--r--accel-pppd/ifcfg.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c
index 956ec6ee..109751a0 100644
--- a/accel-pppd/ifcfg.c
+++ b/accel-pppd/ifcfg.c
@@ -45,16 +45,6 @@ static void devconf(struct ap_session *ses, const char *attr, const char *val)
close(fd);
}
-/*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);
-}*/
-
void ap_session_ifup(struct ap_session *ses)
{
if (ses->ifname_rename) {
@@ -159,7 +149,7 @@ void __export ap_session_accounting_started(struct ap_session *ses)
if (ses->ctrl->ppp) {
ifr6.ifr6_addr.s6_addr32[0] = htonl(0xfe800000);
- *(uint64_t *)(ifr6.ifr6_addr.s6_addr + 8) = ses->ipv6->intf_id;
+ memcpy(ifr6.ifr6_addr.s6_addr + 8, &ses->ipv6->intf_id, 8);
ifr6.ifr6_prefixlen = 64;
ifr6.ifr6_ifindex = ses->ifindex;
@@ -170,7 +160,7 @@ void __export ap_session_accounting_started(struct ap_session *ses)
list_for_each_entry(a, &ses->ipv6->addr_list, entry) {
a->installed = 0;
/*if (a->prefix_len < 128) {
- build_addr(a, ses->ipv6->intf_id, &ifr6.ifr6_addr);
+ build_ip6_addr(a, ses->ipv6->intf_id, &ifr6.ifr6_addr);
ifr6.ifr6_prefixlen = a->prefix_len;
if (ioctl(sock6_fd, SIOCSIFADDR, &ifr6))