X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=src%2Fodhcp6c.c;h=2668d949bdedc9050572f3497ab06e62d04b9870;hb=b4a0f3d74b04074eae21e88fbf5b8f2ddc150f86;hp=c4ce7d77155a8d1532efe24a263ae5678fa81f52;hpb=82b41d8ac963598f437e57f720b3726939668b5d;p=odhcp6c.git diff --git a/src/odhcp6c.c b/src/odhcp6c.c index c4ce7d7..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));