]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Expire RDNSS and DNSSL options if the RA expires.
authorRoy Marples <roy@marples.name>
Wed, 14 Nov 2012 10:30:50 +0000 (10:30 +0000)
committerRoy Marples <roy@marples.name>
Wed, 14 Nov 2012 10:30:50 +0000 (10:30 +0000)
ipv6rs.c

index 7449de7e123f9a58d62fac1136317d831979dc78..0972ffdeb17752cbded5b21111355fe6905f1c26 100644 (file)
--- 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, >)) {