diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2021-02-28 17:49:02 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2021-02-28 17:49:02 +0000 |
commit | 0a5a62e1b2db3884ecab3426a7eb81dd199b272e (patch) | |
tree | afe38cf5d9ccfa3fffd4afeffa4bde78f05246d9 /sbin/dhclient | |
parent | 5f0ce58efe197ecff9a1d1d0c240f1a48aba1242 (diff) |
Move tick_msg(TICK_WAIT) calls after related log_debug()
calls to avoid losing those debug messages if
tick_msg() notices link-timeout has expired and daemonizes
dhclient.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r-- | sbin/dhclient/dhclient.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 34791632860..6ad8cd01515 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.706 2021/02/28 17:33:45 krw Exp $ */ +/* $OpenBSD: dhclient.c,v 1.707 2021/02/28 17:49:01 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -256,10 +256,10 @@ interface_state(struct interface_info *ifi) newlinkup = LINK_STATE_IS_UP(ifi->link_state); if (newlinkup != oldlinkup) { - tick_msg("link", newlinkup ? TICK_SUCCESS : TICK_WAIT); log_debug("%s: link %s -> %s", log_procname, (oldlinkup != 0) ? "up" : "down", (newlinkup != 0) ? "up" : "down"); + tick_msg("link", newlinkup ? TICK_SUCCESS : TICK_WAIT); } if (newlinkup != 0) { @@ -1433,8 +1433,6 @@ send_discover(struct interface_info *ifi) return; } - tick_msg("lease", TICK_WAIT); - set_interval(ifi, cur_time); set_secs(ifi, cur_time); @@ -1443,6 +1441,7 @@ send_discover(struct interface_info *ifi) log_debug("%s: DHCPDISCOVER - interval %lld", log_procname, (long long)ifi->interval); + tick_msg("lease", TICK_WAIT); set_timeout(ifi, ifi->interval, send_discover); } @@ -1489,7 +1488,6 @@ send_request(struct interface_info *ifi) cancel_timeout(ifi); clock_gettime(CLOCK_REALTIME, &now); cur_time = now.tv_sec; - tick_msg("lease", TICK_WAIT); /* Figure out how long it's been since we started transmitting. */ interval = cur_time - ifi->first_sending; @@ -1547,6 +1545,7 @@ send_request(struct interface_info *ifi) log_debug("%s: DHCPREQUEST to %s", log_procname, inet_ntoa(destination.sin_addr)); + tick_msg("lease", TICK_WAIT); set_timeout(ifi, ifi->interval, send_request); } |