summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorVladislav Grishenko <themiron@mail.ru>2018-01-12 02:54:59 +0500
committerVladislav Grishenko <themiron@mail.ru>2018-01-13 02:07:45 +0500
commit2bec9805e11d591fb638908f78d82e7f62463a51 (patch)
tree6a95b4a56093a3c261517c7f7a3b6571e7ed7c49 /accel-pppd
parenta9708f9bf8d7225d9fa137c7734ccc3cbc2121c3 (diff)
downloadaccel-ppp-2bec9805e11d591fb638908f78d82e7f62463a51.tar.gz
accel-ppp-2bec9805e11d591fb638908f78d82e7f62463a51.zip
ipv6: use macro for unspecified address ckecking
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/ipv6/dhcpv6.c3
-rw-r--r--accel-pppd/ipv6/nd.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c
index c43cadc5..a5fbdf41 100644
--- a/accel-pppd/ipv6/dhcpv6.c
+++ b/accel-pppd/ipv6/dhcpv6.c
@@ -52,7 +52,6 @@ struct dhcpv6_pd {
};
static void *pd_key;
-static struct in6_addr null_addr;
static int dhcpv6_read(struct triton_md_handler_t *h);
@@ -69,7 +68,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 || memcmp(a->addr.s6_addr, null_addr.s6_addr, sizeof(null_addr)) == 0)
+ if (a->prefix_len == 0 || IN6_IS_ADDR_UNSPECIFIED(&a->addr))
return;
sock = net->socket(AF_INET6, SOCK_DGRAM, 0);
diff --git a/accel-pppd/ipv6/nd.c b/accel-pppd/ipv6/nd.c
index a93724cd..c80f068c 100644
--- a/accel-pppd/ipv6/nd.c
+++ b/accel-pppd/ipv6/nd.c
@@ -90,7 +90,6 @@ struct ipv6_nd_handler_t
};
static void *pd_key;
-static struct in6_addr null_addr;
#define BUF_SIZE 1024
static mempool_t buf_pool;
@@ -383,7 +382,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 && memcmp(a->addr.s6_addr, null_addr.s6_addr, sizeof(null_addr))) {
+ if (a->prefix_len && !IN6_IS_ADDR_UNSPECIFIED(&a->addr)) {
ipv6_nd_start(ses);
break;
}