From: Steven Barth Date: Fri, 1 Feb 2013 12:01:09 +0000 (+0100) Subject: Fix entry-update logic X-Git-Tag: debian/1.1+git20160131-1~182 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=7b3e29a4ff20f1b1e91fa65b5a0631462dbee06d;p=odhcp6c.git Fix entry-update logic --- 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)); }