-/* $OpenBSD: clparse.c,v 1.201 2020/12/10 18:35:31 krw Exp $ */
+/* $OpenBSD: clparse.c,v 1.202 2021/02/21 18:16:59 krw Exp $ */
/* Parser for dhclient config and lease files. */
TAILQ_INIT(&config->reject_list);
/* Set some defaults. */
- config->link_timeout = 10; /* secs before going daemon w/o lease */
+ config->link_interval = 10; /* secs before going daemon w/o lease */
config->select_interval = 0; /* secs to wait for other OFFERs */
config->retry_interval = 1; /* secs before asking for OFFER */
#ifdef SMALL
config->backoff_cutoff = 2; /* max secs between packet retries */
- config->reboot_timeout = 5; /* secs before giving up on reboot */
- config->timeout = 10; /* secs to wait for an OFFER */
+ config->reboot_interval = 5; /* secs before giving up on reboot */
+ config->offer_interval = 10; /* secs to wait for an OFFER */
#else
config->backoff_cutoff = 10; /* max secs between packet retries */
- config->reboot_timeout = 1; /* secs before giving up on reboot */
- config->timeout = 30; /* secs to wait for an OFFER */
+ config->reboot_interval = 1; /* secs before giving up on reboot */
+ config->offer_interval = 30; /* secs to wait for an OFFER */
#endif
config->initial_interval = 1; /* secs before 1st retry */
parse_interface(cfile, name);
return;
case TOK_LINK_TIMEOUT:
- if (parse_number(cfile, &config->link_timeout, 0, INT32_MAX)
+ if (parse_number(cfile, &config->link_interval, 0, INT32_MAX)
== 0)
return;
break;
config->default_actions[i] = action;
break;
case TOK_REBOOT:
- if (parse_number(cfile, &config->reboot_timeout, 0, INT32_MAX)
+ if (parse_number(cfile, &config->reboot_interval, 0, INT32_MAX)
== 0)
return;
break;
config->default_actions[i] = ACTION_SUPERSEDE;
break;
case TOK_TIMEOUT:
- if (parse_number(cfile, &config->timeout, 0, INT32_MAX) == 0)
+ if (parse_number(cfile, &config->offer_interval, 0, INT32_MAX)
+ == 0)
return;
break;
case TOK_USELEASE:
-/* $OpenBSD: dhclient.c,v 1.696 2021/02/21 14:30:29 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.697 2021/02/21 18:16:59 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
if (interval == 0) {
if (ifi->state == S_REBOOTING)
- interval = config->reboot_timeout;
+ interval = config->reboot_interval;
else
interval = config->initial_interval;
} else {
interval = ifi->expiry - cur_time;
break;
case S_REQUESTING:
- if (cur_time + interval > ifi->first_sending + config->timeout)
- interval = (ifi->first_sending + config->timeout) - cur_time;
+ if (cur_time + interval > ifi->first_sending + config->offer_interval)
+ interval = (ifi->first_sending + config->offer_interval) - cur_time;
break;
default:
break;
}
- if (cur_time < ifi->startup_time + config->link_timeout)
+ if (cur_time < ifi->startup_time + config->link_interval)
interval = 1;
ifi->interval = interval ? interval : 1;
if (log_getverbose())
tick_msg("lease", TICK_WAIT);
- if (cur_time > ifi->first_sending + config->timeout) {
+ if (cur_time > ifi->first_sending + config->offer_interval) {
state_panic(ifi);
return;
}
switch (ifi->state) {
case S_REBOOTING:
- if (interval > config->reboot_timeout)
+ if (interval > config->reboot_interval)
ifi->state = S_INIT;
else {
destination.sin_addr.s_addr = INADDR_BROADCAST;
}
break;
case S_REQUESTING:
- if (interval > config->timeout)
+ if (interval > config->offer_interval)
ifi->state = S_INIT;
else {
destination.sin_addr.s_addr = INADDR_BROADCAST;
tick_msg(const char *preamble, int action)
{
const struct timespec grace_intvl = {3, 0};
- const struct timespec link_intvl = {config->link_timeout, 0};
+ const struct timespec link_intvl = {config->link_interval, 0};
static struct timespec grace, stop;
struct timespec now;
static int preamble_sent, sleeping;
-/* $OpenBSD: dhcpd.h,v 1.291 2021/02/01 01:42:20 krw Exp $ */
+/* $OpenBSD: dhcpd.h,v 1.292 2021/02/21 18:16:59 krw Exp $ */
/*
* Copyright (c) 2004 Henning Brauer <henning@openbsd.org>
uint8_t requested_options[DHO_COUNT];
int requested_option_count;
int required_option_count;
- time_t timeout;
+ time_t offer_interval;
time_t initial_interval;
- time_t link_timeout;
+ time_t link_interval;
time_t retry_interval;
time_t select_interval;
- time_t reboot_timeout;
+ time_t reboot_interval;
time_t backoff_cutoff;
TAILQ_HEAD(, reject_elem) reject_list;
char *filename;