summaryrefslogtreecommitdiffstats
path: root/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-06-09 19:47:53 +0000
committerRoy Marples <roy@marples.name>2015-06-09 19:47:53 +0000
commit5b1f21d131bf0427f18a5be1499889fd194b9b1d (patch)
tree1ea4b701f10fa131bc3551b0011977d75041836b /ipv6nd.c
parent67daaa59ded7b3240654bd52506595e76e482073 (diff)
downloaddhcpcd-5b1f21d131bf0427f18a5be1499889fd194b9b1d.tar.xz
Remove if_oneup and replace with if_afwaited and af_waited.
If present, they will show the address family waiting for.
Diffstat (limited to 'ipv6nd.c')
-rw-r--r--ipv6nd.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/ipv6nd.c b/ipv6nd.c
index 74b11cac..fe368dbd 100644
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -432,19 +432,13 @@ ipv6nd_iffindaddr(const struct interface *ifp, const struct in6_addr *addr,
if (rap->iface != ifp)
continue;
TAILQ_FOREACH(ap, &rap->addrs, next) {
- if (addr == NULL) {
- if ((ap->flags &
- (IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED)) ==
- (IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED))
- return ap;
- } else if (ap->prefix_vltime &&
- IN6_ARE_ADDR_EQUAL(&ap->addr, addr) &&
- (!flags || ap->flags & flags))
+ if (ipv6_findaddrmatch(ap, addr, flags))
return ap;
}
}
return NULL;
}
+
struct ipv6_addr *
ipv6nd_findaddr(struct dhcpcd_ctx *ctx, const struct in6_addr *addr,
short flags)
@@ -457,14 +451,7 @@ ipv6nd_findaddr(struct dhcpcd_ctx *ctx, const struct in6_addr *addr,
TAILQ_FOREACH(rap, ctx->ipv6->ra_routers, next) {
TAILQ_FOREACH(ap, &rap->addrs, next) {
- if (addr == NULL) {
- if ((ap->flags &
- (IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED)) ==
- (IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED))
- return ap;
- } else if (ap->prefix_vltime &&
- IN6_ARE_ADDR_EQUAL(&ap->addr, addr) &&
- (!flags || ap->flags & flags))
+ if (ipv6_findaddrmatch(ap, addr, flags))
return ap;
}
}