X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=src%2Fodhcp6c.c;h=2668d949bdedc9050572f3497ab06e62d04b9870;hb=b4a0f3d74b04074eae21e88fbf5b8f2ddc150f86;hp=4a9267dc19e490781c7cadf7ac8261ab32755836;hpb=3f3f2531deacf11afbc4f96f6dfbf8c47753215d;p=odhcp6c.git diff --git a/src/odhcp6c.c b/src/odhcp6c.c index 4a9267d..2668d94 100644 --- a/src/odhcp6c.c +++ b/src/odhcp6c.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 @@ -115,7 +115,7 @@ int main(_unused int argc, char* const argv[]) int prefix_length = strtoul(optarg, &iaid_begin, 10); - if (*iaid_begin != '\0' && *iaid_begin != ',') { + if (*iaid_begin != '\0' && *iaid_begin != ',' && *iaid_begin != ':') { syslog(LOG_ERR, "invalid argument: '%s'", optarg); return 1; } @@ -124,8 +124,10 @@ int main(_unused int argc, char* const argv[]) if (*iaid_begin == ',' && (iaid_len = strlen(iaid_begin)) > 1) memcpy(&prefix.iaid, iaid_begin + 1, iaid_len > 4 ? 4 : iaid_len); + else if (*iaid_begin == ':') + prefix.iaid = htonl((uint32_t)strtoul(&iaid_begin[1], NULL, 16)); else - prefix.iaid = ++ia_pd_iaid_index; + prefix.iaid = htonl(++ia_pd_iaid_index); odhcp6c_add_state(STATE_IA_PD_INIT, &prefix, sizeof(prefix)); @@ -439,7 +441,7 @@ static int usage(void) " -k Don't send a RELEASE when stopping\n" " -t Maximum timeout for DHCPv6-SOLICIT (120)\n" "\nInvocation options:\n" - " -p Set pidfile (/var/run/6relayd.pid)\n" + " -p Set pidfile (/var/run/odhcp6c.pid)\n" " -d Daemonize\n" " -e Write logmessages to stderr\n" //" -v Increase logging verbosity\n"