summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2021-02-21 14:30:30 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2021-02-21 14:30:30 +0000
commitcb34fe7cce44a4b4b86d20eac5511800d250c860 (patch)
tree1ce49a6d9742eee97ee1b26f1d580ee308a6873e
parent65d7b432e877696fadb1c62f52f23d4927b3893b (diff)
No need for state_preboot() to double check timeout being
tracked in tick_msg() and explicitly calling tick_msg(TICK_SLEEP). One fewer use of each of time(), ifi->startup_time and config->link_timeout. Makes code easier to follow. No intentional functional change.
-rw-r--r--sbin/dhclient/dhclient.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index b518fdca28b..78d4dd47d75 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.695 2021/02/20 14:56:59 krw Exp $ */
+/* $OpenBSD: dhclient.c,v 1.696 2021/02/21 14:30:29 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -793,10 +793,6 @@ usage(void)
void
state_preboot(struct interface_info *ifi)
{
- time_t cur_time;
-
- time(&cur_time);
-
interface_state(ifi);
if (quit != 0)
return;
@@ -806,14 +802,8 @@ state_preboot(struct interface_info *ifi)
ifi->state = S_REBOOTING;
state_reboot(ifi);
} else {
- if (cur_time < ifi->startup_time + config->link_timeout) {
- tick_msg("link", TICK_WAIT);
- set_timeout(ifi, 1, state_preboot);
- } else {
- tick_msg("link", TICK_SLEEP);
- go_daemon();
- cancel_timeout(ifi); /* Wait for RTM_IFINFO. */
- }
+ tick_msg("link", TICK_WAIT);
+ set_timeout(ifi, 1, state_preboot);
}
}