summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2012-11-14 10:30:50 +0000
committerRoy Marples <roy@marples.name>2012-11-14 10:30:50 +0000
commit27ac6d558ade98bc0ef7a14b15ac35ed83d83d95 (patch)
tree7c2b436312705e6a950dc5fcbf88246993c2c3b1
parent560c572f2b53a84a73005d350862f1d376db0557 (diff)
downloaddhcpcd-27ac6d558ade98bc0ef7a14b15ac35ed83d83d95.tar.xz
Expire RDNSS and DNSSL options if the RA expires.
-rw-r--r--ipv6rs.c15
1 files changed, 15 insertions, 0 deletions
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, >)) {