summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorCesar Fazan <cesar.fazan@gmail.com>2015-02-22 02:55:00 -0300
committerDmitry Kozlov <xeb@mail.ru>2015-02-22 09:13:18 +0300
commit408a04d008ffe0c99c60ca6603c8369cd999b844 (patch)
treee0e3fee5e7bd2ba4edb4bff8deb47d0a562fa4ac /accel-pppd
parent2a9fe3c6710bb42049886f0ba91a0db7d15c33ae (diff)
downloadaccel-ppp-408a04d008ffe0c99c60ca6603c8369cd999b844.tar.gz
accel-ppp-408a04d008ffe0c99c60ca6603c8369cd999b844.zip
Small IPv6 fixes for PPP
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ifcfg.c4
-rw-r--r--accel-pppd/ppp/ipv6cp_opt_intfid.c2
-rw-r--r--accel-pppd/ppp/ppp_ifcfg.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/accel-pppd/ifcfg.c b/accel-pppd/ifcfg.c
index 685e1de1..5c828a78 100644
--- a/accel-pppd/ifcfg.c
+++ b/accel-pppd/ifcfg.c
@@ -156,7 +156,7 @@ void __export ap_session_accounting_started(struct ap_session *ses)
memset(&ifr6, 0, sizeof(ifr6));
if (ses->ctrl->ppp) {
- ifr6.ifr6_addr.s6_addr32[0] = htons(0xfe80);
+ ifr6.ifr6_addr.s6_addr32[0] = htonl(0xfe800000);
*(uint64_t *)(ifr6.ifr6_addr.s6_addr + 8) = ses->ipv6->intf_id;
ifr6.ifr6_prefixlen = 64;
ifr6.ifr6_ifindex = ses->ifindex;
@@ -239,7 +239,7 @@ void __export ap_session_ifdown(struct ap_session *ses)
if (ses->ipv6) {
memset(&ifr6, 0, sizeof(ifr6));
- ifr6.ifr6_addr.s6_addr32[0] = htons(0xfe80);
+ ifr6.ifr6_addr.s6_addr32[0] = htonl(0xfe800000);
*(uint64_t *)(ifr6.ifr6_addr.s6_addr + 8) = ses->ipv6->intf_id;
ifr6.ifr6_prefixlen = 64;
ifr6.ifr6_ifindex = ses->ifindex;
diff --git a/accel-pppd/ppp/ipv6cp_opt_intfid.c b/accel-pppd/ppp/ipv6cp_opt_intfid.c
index aa7afb61..4f019b63 100644
--- a/accel-pppd/ppp/ipv6cp_opt_intfid.c
+++ b/accel-pppd/ppp/ipv6cp_opt_intfid.c
@@ -127,7 +127,7 @@ static int check_exists(struct ppp_t *self_ppp)
continue;
list_for_each_entry(a1, &ses->ipv6->addr_list, entry) {
- list_for_each_entry(a2, &ses->ipv6->addr_list, entry) {
+ list_for_each_entry(a2, &self_ppp->ses.ipv6->addr_list, entry) {
if (a1->addr.s6_addr32[0] == a2->addr.s6_addr32[0] &&
a1->addr.s6_addr32[1] == a2->addr.s6_addr32[1]) {
log_ppp_warn("ppp: requested IPv6 address already assigned to %s\n", ses->ifname);
diff --git a/accel-pppd/ppp/ppp_ifcfg.c b/accel-pppd/ppp/ppp_ifcfg.c
index f6eba064..f2d6bff1 100644
--- a/accel-pppd/ppp/ppp_ifcfg.c
+++ b/accel-pppd/ppp/ppp_ifcfg.c
@@ -92,7 +92,7 @@ void ppp_ifup(struct ppp_t *ppp)
devconf(ppp, "forwarding", "1");
memset(&ifr6, 0, sizeof(ifr6));
- ifr6.ifr6_addr.s6_addr32[0] = htons(0xfe80);
+ ifr6.ifr6_addr.s6_addr32[0] = htonl(0xfe800000);
*(uint64_t *)(ifr6.ifr6_addr.s6_addr + 8) = ppp->ses.ipv6->intf_id;
ifr6.ifr6_prefixlen = 64;
ifr6.ifr6_ifindex = ppp->ifindex;
@@ -161,7 +161,7 @@ void __export ppp_ifdown(struct ppp_t *ppp)
if (ppp->ses.ipv6) {
memset(&ifr6, 0, sizeof(ifr6));
- ifr6.ifr6_addr.s6_addr32[0] = htons(0xfe80);
+ ifr6.ifr6_addr.s6_addr32[0] = htonl(0xfe800000);
*(uint64_t *)(ifr6.ifr6_addr.s6_addr + 8) = ppp->ses.ipv6->intf_id;
ifr6.ifr6_prefixlen = 64;
ifr6.ifr6_ifindex = ppp->ifindex;