diff options
author | 2021-03-28 17:25:21 +0000 | |
---|---|---|
committer | 2021-03-28 17:25:21 +0000 | |
commit | 1e3e204afb9be07f86f57ea9b3e93211a062b7a7 (patch) | |
tree | bc95cc1bb44cd2d70a0cb7ea1ec8497386a67d42 /sbin/dhclient/dispatch.c | |
parent | Convert remaining timers (lease renew, rebind, expiry) to (diff) | |
download | wireguard-openbsd-1e3e204afb9be07f86f57ea9b3e93211a062b7a7.tar.xz wireguard-openbsd-1e3e204afb9be07f86f57ea9b3e93211a062b7a7.zip |
Now that the real time and monotonic time streams don't
cross flip CLOCK_REALTIME to CLOCK_MONOTONIC.
Suggested by cheloha@, millert@, otto@ at various
stages in the time_t -> timespec conversion.
Diffstat (limited to 'sbin/dhclient/dispatch.c')
-rw-r--r-- | sbin/dhclient/dispatch.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c index 8d8eda6d83d..5951ba8efd3 100644 --- a/sbin/dhclient/dispatch.c +++ b/sbin/dhclient/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.171 2021/03/09 14:32:24 krw Exp $ */ +/* $OpenBSD: dispatch.c,v 1.172 2021/03/28 17:25:21 krw Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -96,7 +96,7 @@ dispatch(struct interface_info *ifi, int routefd) while (quit == 0 || quit == RESTART) { if (quit == RESTART) { quit = 0; - clock_gettime(CLOCK_REALTIME, &ifi->link_timeout); + clock_gettime(CLOCK_MONOTONIC, &ifi->link_timeout); timespecadd(&ifi->link_timeout, &link_intvl, &ifi->link_timeout); free(ifi->configured); ifi->configured = NULL; @@ -106,7 +106,7 @@ dispatch(struct interface_info *ifi, int routefd) state_preboot(ifi); } if (timespecisset(&ifi->timeout)) { - clock_gettime(CLOCK_REALTIME, &timeout); + clock_gettime(CLOCK_MONOTONIC, &timeout); if (timespeccmp(&timeout, &ifi->timeout, >=)) { func = ifi->timeout_func; cancel_timeout(ifi); @@ -307,7 +307,7 @@ set_timeout(struct interface_info *ifi, time_t secs, { struct timespec now; - clock_gettime(CLOCK_REALTIME, &now); + clock_gettime(CLOCK_MONOTONIC, &now); timespecclear(&ifi->timeout); ifi->timeout.tv_sec = secs; timespecadd(&ifi->timeout, &now, &ifi->timeout); |