From: Roy Marples Date: Wed, 31 Oct 2012 22:56:41 +0000 (+0000) Subject: Expire RDNSS and DNSSL options if the RA expires. X-Git-Tag: v5.99.3~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47102c834608b759a5c899ace1538962e0cd3731;p=thirdparty%2Fdhcpcd.git Expire RDNSS and DNSSL options if the RA expires. --- diff --git a/ipv6rs.c b/ipv6rs.c index 89b3e756..fda72472 100644 --- a/ipv6rs.c +++ b/ipv6rs.c @@ -948,6 +948,21 @@ ipv6rs_expire(void *arg) } TAILQ_FOREACH_SAFE(rao, &rap->options, next, raon) { + if (rap->expired) { + switch(rao->type) { + case ND_OPT_RDNSS: /* FALLTHROUGH */ + case ND_OPT_DNSSL: + /* RFC6018 end of section 5.2 states + * that if tha RA has a lifetime of 0 + * then we should expire these + * options */ + TAILQ_REMOVE(&rap->options, rao, next); + expired = 1; + free(rao->option); + free(rao); + continue; + } + } if (!timerisset(&rao->expire)) continue; if (timercmp(&now, &rao->expire, >)) {