summaryrefslogtreecommitdiff
path: root/sbin/dhclient/dispatch.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2018-01-24 19:12:50 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2018-01-24 19:12:50 +0000
commit336ba163d3caf8044c83e2651be02ad96fa0c919 (patch)
tree6f63e5067e3391fc7428c4e420ee504f84a5910c /sbin/dhclient/dispatch.c
parent2eac49c3e2227d1811f52e8eb089ffc98bd4da7c (diff)
Don't display the seconds until renewal. i.e. "em0: bound to 1.2.3.4
-- renewal in 300000 seconds" becomes simply "em0: bound to 1.2.3.4" While here avoid setting timeouts before the current time. ok florian@
Diffstat (limited to 'sbin/dhclient/dispatch.c')
-rw-r--r--sbin/dhclient/dispatch.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/dhclient/dispatch.c b/sbin/dhclient/dispatch.c
index f5916c9be55..ef3005baf92 100644
--- a/sbin/dhclient/dispatch.c
+++ b/sbin/dhclient/dispatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dispatch.c,v 1.146 2017/09/20 22:05:10 krw Exp $ */
+/* $OpenBSD: dispatch.c,v 1.147 2018/01/24 19:12:49 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -325,7 +325,8 @@ set_timeout(struct interface_info *ifi, time_t secs,
void (*where)(struct interface_info *))
{
time(&ifi->timeout);
- ifi->timeout += secs;
+ if (secs > 0)
+ ifi->timeout += secs;
ifi->timeout_func = where;
}