From: krw Date: Sun, 21 Feb 2021 14:30:29 +0000 (+0000) Subject: No need for state_preboot() to double check timeout being X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=56fd2a2340168941d6c73616d08a997ba7ec6024;p=openbsd 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. --- 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 @@ -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); } }