summaryrefslogtreecommitdiffstats
path: root/ipv6nd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2014-10-14 23:42:14 +0000
committerRoy Marples <roy@marples.name>2014-10-14 23:42:14 +0000
commit9adc479cfb2e50224e03ef75b83fc578ed7789e3 (patch)
tree9687d7f2095787eda7408625fd9271315c028bb8 /ipv6nd.c
parentfd3e7f651937b23a6997c7c961d32708942655a3 (diff)
downloaddhcpcd-9adc479cfb2e50224e03ef75b83fc578ed7789e3.tar.xz
When receiving a RA, mark all addresses as stale. For each address
created in the RA, remove the stale marking. Addresses marked stale won't be re-added so will naturally expire.
Diffstat (limited to 'ipv6nd.c')
-rw-r--r--ipv6nd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ipv6nd.c b/ipv6nd.c
index 859ec69b..0fd39334 100644
--- a/ipv6nd.c
+++ b/ipv6nd.c
@@ -827,6 +827,10 @@ ipv6nd_handlera(struct ipv6_ctx *ctx, struct interface *ifp,
if (rap->lifetime)
rap->expired = 0;
+ TAILQ_FOREACH(ap, &rap->addrs, next) {
+ ap->flags |= IPV6_AF_STALE;
+ }
+
len -= sizeof(struct nd_router_advert);
p = ((uint8_t *)icp) + sizeof(struct nd_router_advert);
lifetime = ~0U;
@@ -923,7 +927,8 @@ ipv6nd_handlera(struct ipv6_ctx *ctx, struct interface *ifp,
}
ap->dadcallback = ipv6nd_dadcallback;
TAILQ_INSERT_TAIL(&rap->addrs, ap, next);
- }
+ } else
+ ap->flags &= ~IPV6_AF_STALE;
if (pi->nd_opt_pi_flags_reserved &
ND_OPT_PI_FLAG_ONLINK)
ap->flags |= IPV6_AF_ONLINK;