From: Steven Barth Date: Wed, 30 Jan 2013 20:05:37 +0000 (+0100) Subject: Fix safe entry manipulation X-Git-Tag: debian/1.1+git20160131-1~196 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=commitdiff_plain;h=61effec4509b2c0d6e3c0ee8b7ae0d318b08868e;hp=806ebbc1f4dd848c2d19b56f5be84db16fada612 Fix safe entry manipulation --- diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 6266aa4..e4da1ab 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -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) diff --git a/src/ra.c b/src/ra.c index 6874601..0d51832 100644 --- 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); } }