2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-30 22:05:23 +00:00

Clean up a loophole in the code that sets up the pool expiry timer.

This commit is contained in:
Ted Lemon
1999-10-28 15:53:05 +00:00
parent c4f749466f
commit a816cb178e

View File

@@ -22,7 +22,7 @@
#ifndef lint #ifndef lint
static char copyright[] = static char copyright[] =
"$Id: mdb.c,v 1.16 1999/10/28 13:07:06 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n"; "$Id: mdb.c,v 1.17 1999/10/28 15:53:05 mellon Exp $ Copyright (c) 1995, 1996, 1997, 1998, 1999 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */ #endif /* not lint */
#include "dhcpd.h" #include "dhcpd.h"
@@ -1036,16 +1036,14 @@ int supersede_lease (comp, lease, commit)
it's run any outstanding expiry events on the it's run any outstanding expiry events on the
pool. */ pool. */
if (comp -> pool) { if (comp -> pool) {
if (!comp -> pool -> next_expiry) { if (!comp -> pool -> next_expiry ||
comp -> pool -> next_expiry = comp; (comp -> ends <
if (commit) comp -> pool -> next_expiry -> ends)) {
add_timeout (comp -> ends, comp -> pool -> next_expiry = comp;
pool_timer, comp -> pool); if (commit)
} else if (comp -> ends < add_timeout (comp -> ends,
comp -> pool -> next_expiry -> ends) { pool_timer,
if (commit) comp -> pool);
add_timeout (comp -> ends,
pool_timer, comp -> pool);
} }
} }
} }