diff options
| author | Roy Marples <roy@marples.name> | 2014-03-03 12:10:58 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-03-03 12:10:58 +0000 |
| commit | 4145d2b68a071aafcd0284b9f0ce0effb3aa7dd7 (patch) | |
| tree | 2133eb55e3c8fbad176623ad046de8b04af60917 /ipv6.c | |
| parent | 1eb71ae8e108d3f3969f679259e434ea819d5e08 (diff) | |
| download | dhcpcd-4145d2b68a071aafcd0284b9f0ce0effb3aa7dd7.tar.xz | |
Expire DHCP lease and then run no carrier as a seperate operation.
Instead of waiting the maximum amount of time to report DAD failure/completion, poll the address flags periodically.
Diffstat (limited to 'ipv6.c')
| -rw-r--r-- | ipv6.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -418,6 +418,31 @@ ipv6_userprefix( return 0; } +#ifdef LISTEN_DAD +void +ipv6_checkaddrflags(void *arg) +{ + struct ipv6_addr *ap; + int ifa_flags; + + ap = arg; + ifa_flags = in6_addr_flags(ap->iface->name, &ap->addr); + if (ifa_flags == -1) + syslog(LOG_ERR, "%s: in6_addr_flags: %m", ap->iface->name); + else if (!(ifa_flags & IN6_IFF_TENTATIVE)) { + ipv6_handleifa(ap->iface->ctx, RTM_NEWADDR, + ap->iface->ctx->ifaces, ap->iface->name, + &ap->addr, ifa_flags); + } else { + struct timeval tv; + + ms_to_tv(&tv, RETRANS_TIMER / 2); + eloop_timeout_add_tv(ap->iface->ctx->eloop, &tv, + ipv6_checkaddrflags, ap); + } +} +#endif + int ipv6_addaddr(struct ipv6_addr *ap) { @@ -866,7 +891,6 @@ make_prefix(const struct interface * ifp, const struct ra *rap, return r; } - static struct rt6 * make_router(const struct ra *rap) { |
