summaryrefslogtreecommitdiff
path: root/sbin/dhclient
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-06-22 23:05:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-06-22 23:05:29 +0000
commitf377df0ef9716a17e47a80b64ece4e815adf3f7d (patch)
treee59f2b135ff3239198c42716c3544331a2a7167e /sbin/dhclient
parente61cfa8f07f05f24b0af51e5a13176809b7250ae (diff)
horrid horrid horrid. we have a race window where we, ourselves, do an
address deletion. yesterday we stopped ignoring deletions. but now dhclient does not see itself coming up, and voila, we get more and processes. so now make a 5-second window where we ignore delete messages, but terminate if we get them at any other time. a very relucant ok from henning who is actively searching for a final solution to this problem.
Diffstat (limited to 'sbin/dhclient')
-rw-r--r--sbin/dhclient/dhclient.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/sbin/dhclient/dhclient.c b/sbin/dhclient/dhclient.c
index bbb70bc9ef4..82851fcb014 100644
--- a/sbin/dhclient/dhclient.c
+++ b/sbin/dhclient/dhclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dhclient.c,v 1.54 2004/06/22 01:33:51 henning Exp $ */
+/* $OpenBSD: dhclient.c,v 1.55 2004/06/22 23:05:28 deraadt Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -114,6 +114,8 @@ int fork_privchld(int, int);
((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long))
#define ADVANCE(x, n) (x += ROUNDUP((n)->sa_len))
+time_t scripttime;
+
int
findproto(char *cp, int n)
{
@@ -214,7 +216,9 @@ routehandler(struct protocol *p)
break;
if (findproto((char *)(ifam + 1), ifam->ifam_addrs) != AF_INET)
break;
- /* goto die; */
+ if (scripttime && time(NULL) > scripttime &&
+ time(NULL) < scripttime + 5)
+ goto die;
break;
case RTM_IFINFO:
ifm = (struct if_msghdr *)rtm;
@@ -1957,6 +1961,8 @@ script_go(void)
struct buf *buf;
int ret;
+ scripttime = time(NULL);
+
hdr.code = IMSG_SCRIPT_GO;
hdr.len = sizeof(struct imsg_hdr);
@@ -1988,6 +1994,8 @@ priv_script_go(void)
struct interface_info *ip = ifi;
int pid, wpid, wstatus;
+ scripttime = time(NULL);
+
if (ip) {
scriptName = ip->client->config->script_name;
envp = ip->client->scriptEnv;