diff options
| author | Roy Marples <roy@marples.name> | 2015-06-09 19:47:53 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2015-06-09 19:47:53 +0000 |
| commit | 5b1f21d131bf0427f18a5be1499889fd194b9b1d (patch) | |
| tree | 1ea4b701f10fa131bc3551b0011977d75041836b /ipv6nd.c | |
| parent | 67daaa59ded7b3240654bd52506595e76e482073 (diff) | |
| download | dhcpcd-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.c | 19 |
1 files changed, 3 insertions, 16 deletions
@@ -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; } } |
