X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=src%2Fodhcp6c.c;h=2d828566ed75be0ddb0eb27b7e169a764754e65a;hb=b5afadae8ed69c98f4e9e6a33dfaf570c5bd9b51;hp=a37de913a7c722a2ed11e110428a0d93d5c57374;hpb=722226c4f1d45c8bf4ac9189523738abcf7d648f;p=odhcp6c.git diff --git a/src/odhcp6c.c b/src/odhcp6c.c index a37de91..2d82856 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.c @@ -429,7 +429,7 @@ static int usage(void) " -F Force IPv6-Prefix\n" " -V Set vendor-class option (base-16 encoded)\n" " -u Set user-class option string\n" - " -c Override client-ID (base-16 encoded)\n" + " -c Override client-ID (base-16 encoded 16-bit type + value)\n" " -i Use a custom interface identifier for RA handling\n" " -r Options to be requested (comma-separated)\n" " -R Do not request any options except those specified with -r\n" @@ -445,7 +445,7 @@ static int usage(void) " -e Write logmessages to stderr\n" " -v Increase logging verbosity\n" " -h Show this help\n\n"; - write(STDERR_FILENO, buf, sizeof(buf)); + fputs(buf, stderr); return 1; } @@ -584,14 +584,12 @@ bool odhcp6c_update_entry(enum odhcp6c_state state, struct odhcp6c_entry *new, new->valid - x->valid < min_update_interval && new->preferred >= x->preferred && new->preferred != UINT32_MAX && - new->preferred - x->preferred < min_update_interval && - x->class == new->class) + new->preferred - x->preferred < min_update_interval) return false; x->valid = new->valid; x->preferred = new->preferred; x->t1 = new->t1; x->t2 = new->t2; - x->class = new->class; x->iaid = new->iaid; } else { odhcp6c_add_state(state, new, sizeof(*new)); @@ -654,9 +652,9 @@ uint32_t odhcp6c_elapsed(void) } -void odhcp6c_random(void *buf, size_t len) +int odhcp6c_random(void *buf, size_t len) { - read(urandom_fd, buf, len); + return read(urandom_fd, buf, len); } bool odhcp6c_is_bound(void)