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 /ipv6.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 'ipv6.c')
| -rw-r--r-- | ipv6.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -752,6 +752,24 @@ ipv6_publicaddr(const struct ipv6_addr *ia) !(ia->addr_flags & IN6_IFF_NOTUSEABLE)); } +int +ipv6_findaddrmatch(const struct ipv6_addr *addr, const struct in6_addr *match, + short flags) +{ + + if (match == NULL) { + if ((addr->flags & + (IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED)) == + (IPV6_AF_ADDED | IPV6_AF_DADCOMPLETED)) + return 1; + } else if (addr->prefix_vltime && + IN6_ARE_ADDR_EQUAL(&addr->addr, match) && + (!flags || addr->flags & flags)) + return 1; + + return 0; +} + struct ipv6_addr * ipv6_findaddr(struct dhcpcd_ctx *ctx, const struct in6_addr *addr, short flags) { @@ -1030,7 +1048,7 @@ ipv6_handleifa(struct dhcpcd_ctx *ctx, } int -ipv6_hasaddr(struct interface *ifp) +ipv6_hasaddr(const struct interface *ifp) { if (ipv6nd_iffindaddr(ifp, NULL, 0) != NULL) |
