diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-06-23 05:15:22 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2004-06-23 05:15:22 +0000 |
commit | 2ff9215ae085c0961f6425b9bbae0fc6b5e5d9a0 (patch) | |
tree | 0fce0c3ae058fa24253db77da9dcacbecba8581b /sbin | |
parent | 025a9f8b92ec66b06cdbde2963f0a14dad6ca27e (diff) |
better dead detect window code; still crap
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/dhclient/dhclient.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c index 82851fcb014..a0908599dc4 100644 --- a/sbin/dhclient/dhclient.c +++ b/sbin/dhclient/dhclient.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhclient.c,v 1.55 2004/06/22 23:05:28 deraadt Exp $ */ +/* $OpenBSD: dhclient.c,v 1.56 2004/06/23 05:15:21 deraadt Exp $ */ /* * Copyright 2004 Henning Brauer <henning@openbsd.org> @@ -174,6 +174,7 @@ routehandler(struct protocol *p) struct ifa_msghdr *ifam; struct if_announcemsghdr *ifan; struct client_lease *l; + time_t t = time(NULL); struct sockaddr *sa; struct iaddr a; ssize_t n; @@ -216,10 +217,9 @@ routehandler(struct protocol *p) break; if (findproto((char *)(ifam + 1), ifam->ifam_addrs) != AF_INET) break; - if (scripttime && time(NULL) > scripttime && - time(NULL) < scripttime + 5) - goto die; - break; + if (scripttime == 0 || t < scripttime + 1) + break; + goto die; case RTM_IFINFO: ifm = (struct if_msghdr *)rtm; if (ifm->ifm_index != ifi->index) @@ -1927,6 +1927,8 @@ script_write_params(char *prefix, struct client_lease *lease) for (i = 0; i < 256; i++) hdr.len += sizeof(int) + lease->options[i].len; + scripttime = time(NULL); + if ((buf = buf_open(hdr.len)) == NULL) error("buf_open: %m"); |