X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=src%2Fscript.c;h=61bab67528efba3e5b5d096a072ea1e746ce43fc;hb=6c8109e0c77d5a54950ba607d1ec1f83d5efb5b7;hp=3041fe73097b558080466f71fc3c3a4a7821e48b;hpb=94eb28a5b61036a21bf794b99de64daa96170f1e;p=odhcp6c.git diff --git a/src/script.c b/src/script.c index 3041fe7..61bab67 100644 --- a/src/script.c +++ b/src/script.c @@ -1,5 +1,5 @@ /** - * Copyright (C) 2012-2013 Steven Barth + * Copyright (C) 2012-2014 Steven Barth * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License v2 as published by @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -175,7 +176,7 @@ static void entry_to_env(const char *name, const void *data, size_t len, enum en inet_ntop(AF_INET6, &e[i].target, &buf[buf_len], INET6_ADDRSTRLEN); buf_len += strlen(&buf[buf_len]); if (type != ENTRY_HOST) { - buf_len += snprintf(&buf[buf_len], 6, "/%hhu", e[i].length); + buf_len += snprintf(&buf[buf_len], 6, "/%"PRIu16, e[i].length); if (type == ENTRY_ROUTE) { buf[buf_len++] = ','; if (!IN6_IS_ADDR_UNSPECIFIED(&e[i].router)) { @@ -190,7 +191,7 @@ static void entry_to_env(const char *name, const void *data, size_t len, enum en if ((type == ENTRY_PREFIX || type == ENTRY_ADDRESS) && e[i].class) buf_len += snprintf(&buf[buf_len], 12, ",class=%u", e[i].class); - else if (type == ENTRY_PREFIX) + else if (type == ENTRY_PREFIX && ntohl(e[i].iaid) != 1) buf_len += snprintf(&buf[buf_len], 16, ",class=%08x", ntohl(e[i].iaid)); if (type == ENTRY_PREFIX && e[i].priority) {