static uint8_t reconf_key[16];
-int init_dhcpv6(const char *ifname, int request_pd, int sol_timeout)
+int init_dhcpv6(const char *ifname, int request_pd, bool strict_options, int sol_timeout)
{
request_prefix = request_pd;
dhcpv6_retx[DHCPV6_MSG_SOLICIT].max_timeo = sol_timeout;
}
// Create ORO
- uint16_t oro[] = {
+ if (!strict_options) {
+ uint16_t oro[] = {
htons(DHCPV6_OPT_SIP_SERVER_D),
htons(DHCPV6_OPT_SIP_SERVER_A),
htons(DHCPV6_OPT_DNS_SERVERS),
#ifdef EXT_PREFIX_CLASS
htons(DHCPV6_OPT_PREFIX_CLASS),
#endif
- };
- odhcp6c_add_state(STATE_ORO, oro, sizeof(oro));
+ };
+ odhcp6c_add_state(STATE_ORO, oro, sizeof(oro));
+ }
// Configure IPv6-options
int val = 1;
int bfd_interval = 0, bfd_loss = 3;
#endif
- bool help = false, daemonize = false;
+ bool help = false, daemonize = false, strict_options = false;
int logopt = LOG_PID;
int c, request_pd = 0;
- while ((c = getopt(argc, argv, "S::N:P:FB:c:i:r:s:kt:hedp:")) != -1) {
+ while ((c = getopt(argc, argv, "S::N:P:FB:c:i:r:Rs:kt:hedp:")) != -1) {
switch (c) {
case 'S':
allow_slaac_only = (optarg) ? atoi(optarg) : -1;
}
break;
+ case 'R':
+ strict_options = true;
+ break;
+
case 's':
script = optarg;
break;
signal(SIGUSR2, sighandler);
if ((urandom_fd = open("/dev/urandom", O_CLOEXEC | O_RDONLY)) < 0 ||
- init_dhcpv6(ifname, request_pd, sol_timeout) ||
+ init_dhcpv6(ifname, request_pd, strict_options, sol_timeout) ||
ra_init(ifname, &ifid) || script_init(script, ifname)) {
syslog(LOG_ERR, "failed to initialize: %s", strerror(errno));
return 3;
" -c <clientid> Override client-ID (base-16 encoded)\n"
" -i <iface-id> Use a custom interface identifier for RA handling\n"
" -r <options> Options to be requested (comma-separated)\n"
+ " -R Do not request any options except those specified with -r\n"
" -s <script> Status update script (/usr/sbin/odhcp6c-update)\n"
" -k Don't send a RELEASE when stopping\n"
" -t <seconds> Maximum timeout for DHCPv6-SOLICIT (120)\n"
};
-int init_dhcpv6(const char *ifname, int request_pd, int sol_timeout);
+int init_dhcpv6(const char *ifname, int request_pd, bool strict_options, int sol_timeout);
void dhcpv6_set_ia_mode(enum odhcp6c_ia_mode na, enum odhcp6c_ia_mode pd);
int dhcpv6_request(enum dhcpv6_msg type);
int dhcpv6_poll_reconfigure(void);