summaryrefslogtreecommitdiffstats
path: root/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-05-19 00:49:14 +0000
committerRoy Marples <roy@marples.name>2014-05-19 00:49:14 +0000
commit047235d751f655120613923724587abc36921b84 (patch)
tree30a0d17360e1ee528ade68ea16d340fdcc4b45a8 /ipv6nd.c
parentdaef8a8242f2ee3bbffd8579f560f79efcc414ea (diff)
downloaddhcpcd-047235d751f655120613923724587abc36921b84.tar.xz
If a DHCPv6 lease expires as well as all IPv6 routers who want DHCPv6, don't restart discover.
Diffstat (limited to 'ipv6nd.c')
-rw-r--r--ipv6nd.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/ipv6nd.c b/ipv6nd.c
index da3817b6..9977fd06 100644
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -1022,18 +1022,34 @@ handle_flag:
}
int
-ipv6nd_has_ra(const struct interface *ifp)
+ipv6nd_hasra(const struct interface *ifp)
{
const struct ra *rap;
if (ifp->ctx->ipv6) {
TAILQ_FOREACH(rap, ifp->ctx->ipv6->ra_routers, next)
- if (rap->iface == ifp)
+ if (rap->iface == ifp && !rap->expired)
return 1;
}
return 0;
}
+int
+ipv6nd_hasradhcp(const struct interface *ifp)
+{
+ const struct ra *rap;
+
+ if (ifp->ctx->ipv6) {
+ TAILQ_FOREACH(rap, ifp->ctx->ipv6->ra_routers, next) {
+ if (rap->iface == ifp &&
+ !rap->expired &&
+ (rap->flags & (ND_RA_FLAG_MANAGED | ND_RA_FLAG_OTHER)))
+ return 1;
+ }
+ }
+ return 0;
+}
+
ssize_t
ipv6nd_env(char **env, const char *prefix, const struct interface *ifp)
{