summaryrefslogtreecommitdiffstats
path: root/ipv6.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 /ipv6.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 'ipv6.c')
-rw-r--r--ipv6.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/ipv6.c b/ipv6.c
index f9119d48..00d74b46 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -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)