X-Git-Url: https://git.decadent.org.uk/gitweb/?p=odhcp6c.git;a=blobdiff_plain;f=src%2Fodhcp6c.c;h=4c534c17b518a66d74688f9131123b2351c9ecc9;hp=2d828566ed75be0ddb0eb27b7e169a764754e65a;hb=e1540ec55e014e538a92a588675e4156a1bddabe;hpb=b5afadae8ed69c98f4e9e6a33dfaf570c5bd9b51 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;