From 61effec4509b2c0d6e3c0ee8b7ae0d318b08868e Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Wed, 30 Jan 2013 21:05:37 +0100 Subject: [PATCH] Fix safe entry manipulation --- src/odhcp6c.c | 2 +- src/ra.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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); } } -- 2.39.5