diff options
| author | Roy Marples <roy@marples.name> | 2015-05-20 10:25:10 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2015-05-20 10:25:10 +0000 |
| commit | edb0ed379d7d4e1cb40aa6f81a68f58a84b17b03 (patch) | |
| tree | be0ae68274e28a14b3ced72576ed2bd538d3324e /ipv6nd.c | |
| parent | 4c4d0308bddb76c84f0de8bee6e1295cc7e341a1 (diff) | |
| download | dhcpcd-edb0ed379d7d4e1cb40aa6f81a68f58a84b17b03.tar.xz | |
Fix waiting for ip address, [1972d664c2].
Diffstat (limited to 'ipv6nd.c')
| -rw-r--r-- | ipv6nd.c | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -418,6 +418,33 @@ ipv6nd_neighbour(struct dhcpcd_ctx *ctx, struct in6_addr *addr, int flags) } } +const struct ipv6_addr * +ipv6nd_iffindaddr(const struct interface *ifp, const struct in6_addr *addr, + short flags) +{ + struct ra *rap; + struct ipv6_addr *ap; + + if (ifp->ctx->ipv6 == NULL) + return NULL; + + TAILQ_FOREACH(rap, ifp->ctx->ipv6->ra_routers, next) { + 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)) + return ap; + } + } + return NULL; +} struct ipv6_addr * ipv6nd_findaddr(struct dhcpcd_ctx *ctx, const struct in6_addr *addr, short flags) |
