]> git.decadent.org.uk Git - odhcp6c.git/commitdiff
Fix safe entry manipulation
authorSteven Barth <steven@midlink.org>
Wed, 30 Jan 2013 20:05:37 +0000 (21:05 +0100)
committerSteven Barth <steven@midlink.org>
Wed, 30 Jan 2013 20:05:37 +0000 (21:05 +0100)
src/odhcp6c.c
src/ra.c

index 6266aa484719feb5be7c4660b95df54e5cfb2a48..e4da1ab2767b36ef067e4cb314f413ff40f779c8 100644 (file)
@@ -393,7 +393,7 @@ void odhcp6c_update_entry_safe(enum odhcp6c_state state, const struct odhcp6c_en
        struct odhcp6c_entry *start = odhcp6c_get_state(state, &len);
 
        if (x && x->valid > new->valid && new->valid < safe)
-               return;
+               new->valid = safe;
 
        if (new->valid > 0) {
                if (x)
index 68746016781c7d4b1b3dc111159f074bf01d015c..0d51832176fd2f59fec2ec1518cec08f857d65e1 100644 (file)
--- a/src/ra.c
+++ b/src/ra.c
@@ -246,7 +246,7 @@ bool ra_process(void)
                                        continue;
 
                                if (pinfo->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_ONLINK)
-                                       odhcp6c_update_entry_safe(STATE_RA_ROUTE, &entry, 7201);
+                                       odhcp6c_update_entry_safe(STATE_RA_ROUTE, &entry, 7200);
 
                                if (!(pinfo->nd_opt_pi_flags_reserved & ND_OPT_PI_FLAG_AUTO) ||
                                                pinfo->nd_opt_pi_prefix_len != 64)
@@ -255,7 +255,7 @@ bool ra_process(void)
                                entry.target.s6_addr32[2] = lladdr.s6_addr32[2];
                                entry.target.s6_addr32[3] = lladdr.s6_addr32[3];
 
-                               odhcp6c_update_entry_safe(STATE_RA_PREFIX, &entry, 7201);
+                               odhcp6c_update_entry_safe(STATE_RA_PREFIX, &entry, 7200);
                        }
 
                }