summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>1999-10-28 15:54:05 +0000
committerTed Lemon <source@isc.org>1999-10-28 15:54:05 +0000
commit9f971e76afae305e3d77b2c4c3567ba3c9a226ef (patch)
tree26320d714abaf770c3f607a53d555e5cbe0f70d1
parent30b507c3c656cc0fb483e94fad526ac4080a49b2 (diff)
downloadisc-dhcp-9f971e76afae305e3d77b2c4c3567ba3c9a226ef.tar.gz
- Clean up a loophole in the code that sets up the pool expiry timer
(thanks to Brian Murrell for catching this).
-rw-r--r--common/memory.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/common/memory.c b/common/memory.c
index 675263e1..a98f0c53 100644
--- a/common/memory.c
+++ b/common/memory.c
@@ -22,7 +22,7 @@
#ifndef lint
static char copyright[] =
-"$Id: memory.c,v 1.52.2.4 1999/10/25 18:33:54 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
+"$Id: memory.c,v 1.52.2.5 1999/10/28 15:54:05 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -667,16 +667,14 @@ int supersede_lease (comp, lease, commit)
it's run any outstanding expiry events on the
pool. */
if (comp -> pool) {
- if (!comp -> pool -> next_expiry) {
- comp -> pool -> next_expiry = comp;
- if (commit)
- add_timeout (comp -> ends,
- pool_timer, comp -> pool);
- } else if (comp -> ends <
- comp -> pool -> next_expiry -> ends) {
- if (commit)
- add_timeout (comp -> ends,
- pool_timer, comp -> pool);
+ if (!comp -> pool -> next_expiry ||
+ (comp -> ends <
+ comp -> pool -> next_expiry -> ends)) {
+ comp -> pool -> next_expiry = comp;
+ if (commit)
+ add_timeout (comp -> ends,
+ pool_timer,
+ comp -> pool);
}
}
}