From: Roy Marples Date: Wed, 14 Nov 2012 10:30:50 +0000 (+0000) Subject: Expire RDNSS and DNSSL options if the RA expires. X-Git-Tag: v5.6.3~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27ac6d558ade98bc0ef7a14b15ac35ed83d83d95;p=thirdparty%2Fdhcpcd.git Expire RDNSS and DNSSL options if the RA expires. --- diff --git a/ipv6rs.c b/ipv6rs.c index 7449de7e..0972ffde 100644 --- a/ipv6rs.c +++ b/ipv6rs.c @@ -937,6 +937,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, >)) {