summaryrefslogtreecommitdiffstats
path: root/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-04-07 21:16:31 +0000
committerRoy Marples <roy@marples.name>2015-04-07 21:16:31 +0000
commita258c8ddf7257976be62c20c6e3749581c037ea1 (patch)
treef2deeec9b4a8386a626f30ce10f79255e30d9bc1 /ipv6.c
parent1f209dc76c8068b15000824f9b85c0a27bf8b14a (diff)
downloaddhcpcd-a258c8ddf7257976be62c20c6e3749581c037ea1.tar.xz
Only take into account useable IPv6 public addresses.
Diffstat (limited to 'ipv6.c')
-rw-r--r--ipv6.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipv6.c b/ipv6.c
index 7ab15d6e..66c2fca1 100644
--- a/ipv6.c
+++ b/ipv6.c
@@ -745,6 +745,14 @@ ipv6_addaddr(struct ipv6_addr *ap, const struct timespec *now)
return 0;
}
+int
+ipv6_publicaddr(const struct ipv6_addr *ia)
+{
+ return (ia->prefix_pltime &&
+ (ia->addr.s6_addr[0] & 0xfe) != 0xc &&
+ !(ia->addr_flags & IN6_IFF_NOTUSEABLE));
+}
+
struct ipv6_addr *
ipv6_findaddr(struct dhcpcd_ctx *ctx, const struct in6_addr *addr, short flags)
{