From f377df0ef9716a17e47a80b64ece4e815adf3f7d Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 22 Jun 2004 23:05:29 +0000 Subject: 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. --- sbin/dhclient/dhclient.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'sbin/dhclient') 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 @@ -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; -- cgit v1.2.3