uint8_t buf[134];
char *optpos;
uint16_t opttype;
+ uint16_t optlen;
enum odhcp6c_ia_mode ia_na_mode = IA_MODE_TRY;
enum odhcp6c_ia_mode ia_pd_mode = IA_MODE_NONE;
int ia_pd_iaid_index = 0;
int c;
unsigned int client_options = DHCPV6_CLIENT_FQDN | DHCPV6_ACCEPT_RECONFIGURE;
- while ((c = getopt(argc, argv, "S::N:V:P:FB:c:i:r:Rs:kt:hedp:fa")) != -1) {
+ while ((c = getopt(argc, argv, "S::N:V:P:FB:c:i:r:Ru:s:kt:hedp:fa")) != -1) {
switch (c) {
case 'S':
allow_slaac_only = (optarg) ? atoi(optarg) : -1;
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;
}
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));
client_options |= DHCPV6_STRICT_OPTIONS;
break;
+ case 'u':
+ optlen = htons(strlen(optarg));
+ odhcp6c_add_state(STATE_USERCLASS, &optlen, 2);
+ odhcp6c_add_state(STATE_USERCLASS, optarg, strlen(optarg));
+ break;
+
case 's':
script = optarg;
break;
" -a Don't send Accept Reconfigure option\n"
" -f Don't send Client FQDN option\n"
" -k Don't send a RELEASE when stopping\n"
- " -t <seconds> Maximum timeout for DHCPv6-SOLICIT (120)\n"
+ " -t <seconds> Maximum timeout for DHCPv6-SOLICIT (3600)\n"
"\nInvocation options:\n"
" -p <pidfile> Set pidfile (/var/run/odhcp6c.pid)\n"
" -d Daemonize\n"
if (new->valid > 0) {
if (x) {
- if (new->valid >= x->valid && new->valid - x->valid < 60 &&
+ if (new->valid >= x->valid && new->valid != UINT32_MAX &&
+ new->valid - x->valid < 60 &&
new->preferred >= x->preferred &&
+ new->preferred != UINT32_MAX &&
new->preferred - x->preferred < 60 &&
x->class == new->class)
return false;