summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2017-12-29 14:26:38 +0300
committerDmitry Kozlov <xeb@mail.ru>2017-12-29 14:26:38 +0300
commitbff66de7a08a6c62d263efc4fd2ef151094c83b7 (patch)
tree951025092e9f368611f8f0398892ef043501e975
parent427c0e0303984c4f582429178a34b4d07d9b4444 (diff)
downloadaccel-ppp-bff66de7a08a6c62d263efc4fd2ef151094c83b7.tar.gz
accel-ppp-bff66de7a08a6c62d263efc4fd2ef151094c83b7.zip
ipv6: ignore "unspecified address" (::/128)
-rw-r--r--accel-pppd/ipv6/dhcpv6.c3
-rw-r--r--accel-pppd/ipv6/nd.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c
index 2122f290..c43cadc5 100644
--- a/accel-pppd/ipv6/dhcpv6.c
+++ b/accel-pppd/ipv6/dhcpv6.c
@@ -52,6 +52,7 @@ struct dhcpv6_pd {
};
static void *pd_key;
+static struct in6_addr null_addr;
static int dhcpv6_read(struct triton_md_handler_t *h);
@@ -68,7 +69,7 @@ static void ev_ses_started(struct ap_session *ses)
return;
a = list_entry(ses->ipv6->addr_list.next, typeof(*a), entry);
- if (a->prefix_len == 0)
+ if (a->prefix_len == 0 || memcmp(a->addr.s6_addr, null_addr.s6_addr, sizeof(null_addr)) == 0)
return;
sock = net->socket(AF_INET6, SOCK_DGRAM, 0);
diff --git a/accel-pppd/ipv6/nd.c b/accel-pppd/ipv6/nd.c
index 231f1802..a93724cd 100644
--- a/accel-pppd/ipv6/nd.c
+++ b/accel-pppd/ipv6/nd.c
@@ -90,6 +90,7 @@ struct ipv6_nd_handler_t
};
static void *pd_key;
+static struct in6_addr null_addr;
#define BUF_SIZE 1024
static mempool_t buf_pool;
@@ -382,7 +383,7 @@ static void ev_ses_started(struct ap_session *ses)
return;
list_for_each_entry(a, &ses->ipv6->addr_list, entry) {
- if (a->prefix_len) {
+ if (a->prefix_len && memcmp(a->addr.s6_addr, null_addr.s6_addr, sizeof(null_addr))) {
ipv6_nd_start(ses);
break;
}