htons(DHCPV6_OPT_SIP_SERVER_A),
htons(DHCPV6_OPT_DNS_SERVERS),
htons(DHCPV6_OPT_DNS_DOMAIN),
- htons(DHCPV6_OPT_UNICAST),
htons(DHCPV6_OPT_SNTP_SERVERS),
htons(DHCPV6_OPT_NTP_SERVER),
htons(DHCPV6_OPT_AFTR_NAME),
htons(DHCPV6_OPT_S46_CONT_LW),
};
odhcp6c_add_state(STATE_ORO, oro, sizeof(oro));
+
+ if (!(client_options & DHCPV6_IGNORE_OPT_UNICAST)) {
+ uint16_t otype = htons(DHCPV6_OPT_UNICAST);
+
+ odhcp6c_add_state(STATE_ORO, &otype, sizeof(otype));
+ }
}
// Configure IPv6-options
cand.preference >= 0) {
cand.preference = pref = odata[0];
} else if (otype == DHCPV6_OPT_UNICAST && olen == sizeof(cand.server_addr)) {
- cand.server_addr = *(struct in6_addr *)odata;
+ if (!(client_options & DHCPV6_IGNORE_OPT_UNICAST))
+ cand.server_addr = *(struct in6_addr *)odata;
+
} else if (otype == DHCPV6_OPT_RECONF_ACCEPT) {
cand.wants_reconfigure = true;
} else if (otype == DHCPV6_OPT_SOL_MAX_RT && olen == 4) {
continue;
updated_IAs += dhcpv6_parse_ia(ia_hdr, odata + olen);
- } else if (otype == DHCPV6_OPT_UNICAST && olen == sizeof(server_addr))
- server_addr = *(struct in6_addr *)odata;
+ } else if (otype == DHCPV6_OPT_UNICAST && olen == sizeof(server_addr)) {
+ if (!(client_options & DHCPV6_IGNORE_OPT_UNICAST))
+ server_addr = *(struct in6_addr *)odata;
+
+ }
else if (otype == DHCPV6_OPT_STATUS && olen >= 2) {
uint8_t *mdata = (olen > 2) ? &odata[2] : NULL;
uint16_t mlen = (olen > 2) ? olen - 2 : 0;
unsigned int ra_options = RA_RDNSS_DEFAULT_LIFETIME;
unsigned int ra_holdoff_interval = RA_MIN_ADV_INTERVAL;
- while ((c = getopt(argc, argv, "S::N:V:P:FB:c:i:r:Ru:x:s:kt:m:Lhedp:fav")) != -1) {
+ while ((c = getopt(argc, argv, "S::N:V:P:FB:c:i:r:Ru:Ux:s:kt:m:Lhedp:fav")) != -1) {
switch (c) {
case 'S':
allow_slaac_only = (optarg) ? atoi(optarg) : -1;
free(o_data);
break;
+ case 'U':
+ client_options |= DHCPV6_IGNORE_OPT_UNICAST;
+ break;
+
case 's':
script = optarg;
break;
" -t <seconds> Maximum timeout for DHCPv6-SOLICIT (120)\n"
" -m <seconds> Minimum time between accepting RA updates (3)\n"
" -L Ignore default lifetime for RDNSS records\n"
+ " -U Ignore Server Unicast option\n"
"\nInvocation options:\n"
" -p <pidfile> Set pidfile (/var/run/odhcp6c.pid)\n"
" -d Daemonize\n"