From e1540ec55e014e538a92a588675e4156a1bddabe Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Sun, 12 Apr 2015 14:02:59 +0200 Subject: [PATCH] Fix odhcp6c_find_entry Signed-off-by: Steven Barth --- src/odhcp6c.c | 4 ++-- src/odhcp6c.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 2d82856..4c534c1 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -553,9 +553,9 @@ void* odhcp6c_get_state(enum odhcp6c_state state, size_t *len) } -struct odhcp6c_entry* odhcp6c_find_entry(enum odhcp6c_state state, const struct odhcp6c_entry *new) +static struct odhcp6c_entry* odhcp6c_find_entry(enum odhcp6c_state state, const struct odhcp6c_entry *new) { - size_t len, cmplen = offsetof(struct odhcp6c_entry, target) + new->length / 8; + size_t len, cmplen = offsetof(struct odhcp6c_entry, target) + ((new->length + 7) / 8); struct odhcp6c_entry *start = odhcp6c_get_state(state, &len); struct odhcp6c_entry *x = NULL; diff --git a/src/odhcp6c.h b/src/odhcp6c.h index f7ddc96..1042136 100644 --- a/src/odhcp6c.h +++ b/src/odhcp6c.h @@ -338,7 +338,6 @@ void* odhcp6c_move_state(enum odhcp6c_state state, size_t *len); void* odhcp6c_get_state(enum odhcp6c_state state, size_t *len); // Entry manipulation -struct odhcp6c_entry* odhcp6c_find_entry(enum odhcp6c_state state, const struct odhcp6c_entry *new); bool odhcp6c_update_entry(enum odhcp6c_state state, struct odhcp6c_entry *new, uint32_t safe, bool filterexcess); void odhcp6c_expire(void); -- 2.39.2