diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2005-11-22 21:33:57 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2005-11-22 21:33:57 +0000 |
commit | b893974d38f04fd8cc11e1d33947b85c26721301 (patch) | |
tree | 6ec42a780ef40b77850483a95fe94cbf6cdedf2a | |
parent | 5d88c87dc33812c27020a1c70455392cc160df47 (diff) |
fix problem of dhcp server looping with "already acking lease"
when busy with short lease times. Fix by and discussed with millert
over a year ago, run at u of a for over a year, but never committed.
ok millert@ cloder@
-rw-r--r-- | usr.sbin/dhcpd/dhcp.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/dhcpd/dhcp.c b/usr.sbin/dhcpd/dhcp.c index a453cc270b4..0b0bbddc9f7 100644 --- a/usr.sbin/dhcpd/dhcp.c +++ b/usr.sbin/dhcpd/dhcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dhcp.c,v 1.19 2005/01/31 22:21:44 claudio Exp $ */ +/* $OpenBSD: dhcp.c,v 1.20 2005/11/22 21:33:56 beck Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 @@ -596,8 +596,13 @@ ack_lease(struct packet *packet, struct lease *lease, unsigned int offer, /* If we're already acking this lease, don't do it again. */ if (lease->state) { - note("already acking lease %s", piaddr(lease->ip_addr)); - return; + if ((lease->flags & STATIC_LEASE) || + cur_time - lease->timestamp < 60) { + note("already acking lease %s", piaddr(lease->ip_addr)); + return; + } + free_lease_state(lease->state, "ACK timed out"); + lease->state = NULL; } if (packet->options[DHO_DHCP_CLASS_IDENTIFIER].len) { |