diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2016-05-12 20:56:16 +0500 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2017-12-05 13:05:30 +0300 |
commit | bead1f775d133dd358671c8a8f3aa3c11b83a35f (patch) | |
tree | 457f93d94b9ee8d37f10833e5271d19b52a195d4 | |
parent | b2e5304764b10fb42bbd79ed16aa4ddede9662a3 (diff) | |
download | accel-ppp-bead1f775d133dd358671c8a8f3aa3c11b83a35f.tar.gz accel-ppp-bead1f775d133dd358671c8a8f3aa3c11b83a35f.zip |
ipv6: nd: fix interface id addresses generation for prefixes > /64
-rw-r--r-- | accel-pppd/extra/pppd_compat.c | 2 | ||||
-rw-r--r-- | accel-pppd/ifcfg.c | 2 | ||||
-rw-r--r-- | accel-pppd/ipv6/dhcpv6.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/accel-pppd/extra/pppd_compat.c b/accel-pppd/extra/pppd_compat.c index 2c8460f..4dfa4ee 100644 --- a/accel-pppd/extra/pppd_compat.c +++ b/accel-pppd/extra/pppd_compat.c @@ -519,7 +519,7 @@ static void build_addr(struct ipv6db_addr_t *a, uint64_t intf_id, struct in6_add if (a->prefix_len <= 64) *(uint64_t *)(addr->s6_addr + 8) = intf_id; else - *(uint64_t *)(addr->s6_addr + 8) |= intf_id & ((1 << (128 - a->prefix_len)) - 1); + *(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) diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c index 246aa64..9fbba15 100644 --- a/accel-pppd/ifcfg.c +++ b/accel-pppd/ifcfg.c @@ -52,7 +52,7 @@ static void devconf(struct ap_session *ses, const char *attr, const char *val) if (a->prefix_len <= 64) *(uint64_t *)(addr->s6_addr + 8) = intf_id; else - *(uint64_t *)(addr->s6_addr + 8) |= intf_id & ((1 << (128 - a->prefix_len)) - 1); + *(uint64_t *)(addr->s6_addr + 8) |= intf_id & htobe64((1 << (128 - a->prefix_len)) - 1); }*/ void ap_session_ifup(struct ap_session *ses) diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c index e170ae2..9145d61 100644 --- a/accel-pppd/ipv6/dhcpv6.c +++ b/accel-pppd/ipv6/dhcpv6.c @@ -164,7 +164,7 @@ static void build_addr(struct ipv6db_addr_t *a, uint64_t intf_id, struct in6_add if (a->prefix_len <= 64) *(uint64_t *)(addr->s6_addr + 8) = intf_id; else - *(uint64_t *)(addr->s6_addr + 8) |= intf_id & ((1 << (128 - a->prefix_len)) - 1); + *(uint64_t *)(addr->s6_addr + 8) |= intf_id & htobe64((1 << (128 - a->prefix_len)) - 1); } static void insert_dp_routes(struct ap_session *ses, struct dhcpv6_pd *pd) |