From 7b3e29a4ff20f1b1e91fa65b5a0631462dbee06d Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Fri, 1 Feb 2013 13:01:09 +0100 Subject: [PATCH] Fix entry-update logic --- src/odhcp6c.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 061cb42..9f7019d 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -409,10 +409,12 @@ void odhcp6c_update_entry_safe(enum odhcp6c_state state, struct odhcp6c_entry *n new->valid = safe; if (new->valid > 0) { - if (x) - *x = *new; - else + if (x) { + x->valid = new->valid; + x->preferred = new->preferred; + } else { odhcp6c_add_state(state, new, sizeof(*new)); + } } else if (x) { odhcp6c_remove_state(state, (x - start) * sizeof(*x), sizeof(*x)); } -- 2.25.1