From 56fd2a2340168941d6c73616d08a997ba7ec6024 Mon Sep 17 00:00:00 2001 From: krw Date: Sun, 21 Feb 2021 14:30:29 +0000 Subject: [PATCH] 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. --- sbin/dhclient/dhclient.c | 16 +++------------- 1 file 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 @@ -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); } } -- 2.20.1