diff options
| author | Roy Marples <roy@marples.name> | 2014-10-14 23:42:14 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-10-14 23:42:14 +0000 |
| commit | 9adc479cfb2e50224e03ef75b83fc578ed7789e3 (patch) | |
| tree | 9687d7f2095787eda7408625fd9271315c028bb8 /ipv6nd.c | |
| parent | fd3e7f651937b23a6997c7c961d32708942655a3 (diff) | |
| download | dhcpcd-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; |
