From: Ted Lemon Date: Thu, 28 Oct 1999 15:53:05 +0000 (+0000) Subject: Clean up a loophole in the code that sets up the pool expiry timer. X-Git-Tag: BCTEL_SPECIAL_19991124~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a816cb178e2fc974139e2370e3a711d77cd7e6c2;p=thirdparty%2Fdhcp.git Clean up a loophole in the code that sets up the pool expiry timer. --- diff --git a/server/mdb.c b/server/mdb.c index 547790d69..f7bfd98fe 100644 --- a/server/mdb.c +++ b/server/mdb.c @@ -22,7 +22,7 @@ #ifndef lint 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 */ #include "dhcpd.h" @@ -1036,16 +1036,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); } } }