diff options
| author | Roy Marples <roy@marples.name> | 2014-05-19 00:49:14 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-05-19 00:49:14 +0000 |
| commit | 047235d751f655120613923724587abc36921b84 (patch) | |
| tree | 30a0d17360e1ee528ade68ea16d340fdcc4b45a8 /ipv6nd.c | |
| parent | daef8a8242f2ee3bbffd8579f560f79efcc414ea (diff) | |
| download | dhcpcd-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.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -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) { |
