summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2015-04-12 14:02:59 +0200
committerSteven Barth <steven@midlink.org>2015-04-12 14:02:59 +0200
commite1540ec55e014e538a92a588675e4156a1bddabe (patch)
treed699f5b0707241ef98c5da314c2307741a61d75a /src
parentb5afadae8ed69c98f4e9e6a33dfaf570c5bd9b51 (diff)
downloadodhcp6c-e1540ec55e014e538a92a588675e4156a1bddabe.tar.gz
Fix odhcp6c_find_entry
Signed-off-by: Steven Barth <steven@midlink.org>
Diffstat (limited to 'src')
-rw-r--r--src/odhcp6c.c4
-rw-r--r--src/odhcp6c.h1
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);