diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2014-07-18 12:13:43 +0400 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-07-18 12:13:43 +0400 |
commit | cddc20689a17a1b30d491cd2021f911a669f6dbc (patch) | |
tree | 36a1bfab828689f5f2e393b78d33c04098bd3884 /accel-pppd/ifcfg.c | |
parent | c6a2a1e18fff35738fac68ffc1e745576bb40a70 (diff) | |
download | accel-ppp-cddc20689a17a1b30d491cd2021f911a669f6dbc.tar.gz accel-ppp-cddc20689a17a1b30d491cd2021f911a669f6dbc.zip |
ipv6: add support for prefixes greater than 64
Diffstat (limited to 'accel-pppd/ifcfg.c')
-rw-r--r-- | accel-pppd/ifcfg.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c index 3aff9eb..3190873 100644 --- a/accel-pppd/ifcfg.c +++ b/accel-pppd/ifcfg.c @@ -13,6 +13,7 @@ #include "linux_ppp.h" #include "triton.h" +#include "iputils.h" #include "events.h" #include "ppp.h" #include "ipdb.h" @@ -150,14 +151,15 @@ void ap_session_ifup(struct ap_session *ses) } list_for_each_entry(a, &ses->ipv6->addr_list, entry) { - if (a->prefix_len == 128) - continue; - - build_addr(a, ses->ipv6->intf_id, &ifr6.ifr6_addr); - ifr6.ifr6_prefixlen = a->prefix_len; - - if (ioctl(sock6_fd, SIOCSIFADDR, &ifr6)) - log_ppp_error("failed to add IPv6 address: %s\n", strerror(errno)); + /*if (a->prefix_len < 128) { + build_addr(a, ses->ipv6->intf_id, &ifr6.ifr6_addr); + ifr6.ifr6_prefixlen = a->prefix_len; + + if (ioctl(sock6_fd, SIOCSIFADDR, &ifr6)) + log_ppp_error("failed to add IPv6 address: %s\n", strerror(errno)); + } else*/ + if (ip6route_add(ses->ifindex, &a->addr, a->prefix_len, 0)) + log_ppp_error("failed to add IPv6 route: %s\n", strerror(errno)); } } |