summaryrefslogtreecommitdiffstats
path: root/src/ipv6.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-04-29 22:41:35 +0100
committerRoy Marples <roy@marples.name>2020-04-29 22:41:35 +0100
commit257dae21343e899ad2667aac9b981fa427b7541b (patch)
tree95c0e18d10395d06d5dea947d930919d69d2a2ab /src/ipv6.c
parent787d42df9d4cbddc1acd771fd86833f0cbce0ede (diff)
downloaddhcpcd-257dae21343e899ad2667aac9b981fa427b7541b.tar.xz
inet6: Mark temp addrs for regen
This solves an infinite loop where new temp addrs regened are added at the tail and we loop endlessly.
Diffstat (limited to 'src/ipv6.c')
-rw-r--r--src/ipv6.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ipv6.c b/src/ipv6.c
index c039e7e6..8ecdf622 100644
--- a/src/ipv6.c
+++ b/src/ipv6.c
@@ -2073,10 +2073,22 @@ ipv6_regentempaddrs(void *arg)
ipv6_regen_desync(ifp, true);
clock_gettime(CLOCK_MONOTONIC, &tv);
+
+ /* Mark addresses for regen so we don't infinite loop. */
TAILQ_FOREACH(ia, &state->addrs, next) {
if (ia->flags & IPV6_AF_TEMPORARY &&
!(ia->flags & IPV6_AF_STALE))
+ ia->flags |= IPV6_AF_REGEN;
+ else
+ ia->flags &= ~IPV6_AF_REGEN;
+ }
+
+ /* Now regen temp addrs */
+ TAILQ_FOREACH(ia, &state->addrs, next) {
+ if (ia->flags & IPV6_AF_REGEN) {
ipv6_regentempaddr0(ia, &tv);
+ ia->flags &= ~IPV6_AF_REGEN;
+ }
}
}
#endif /* IPV6_MANAGETEMPADDR */