#ifndef lint
static char copyright[] =
-"$Id: mdb.c,v 1.29 2000/03/18 02:15:52 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
+"$Id: mdb.c,v 1.30 2000/05/03 06:34:13 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
break;
#endif
if (lp
-#if defined (FAILOVER_PROTOCOL)
+#if !defined (FAILOVER_PROTOCOL)
&& lp -> on_expiry
#endif
) {
if (comp -> on_expiry) {
#endif
if (comp -> ends <= cur_time && commit) {
-#if defined (FAILOVER_PROTOCOL)
- if (comp -> on_expiry) {
-#endif
+ if (comp -> on_expiry) {
execute_statements ((struct packet *)0, lease,
(struct option_state *)0,
(struct option_state *)0, /* XXX */
comp -> on_expiry);
executable_statement_dereference (&comp -> on_expiry,
MDL);
-#if defined (FAILOVER_PROTOCOL)
- }
-#endif
- /* No sense releasing a lease after it's expired. */
- if (comp -> on_release)
- executable_statement_dereference
- (&comp -> on_release, MDL);
+ }
+
+ /* No sense releasing a lease after it's expired. */
+ if (comp -> on_release)
+ executable_statement_dereference
+ (&comp -> on_release, MDL);
} else {
/* If this is the next lease that will timeout on the
pool, zap the old timeout and set the timeout on
for (foo = comp;
foo -> ends == comp -> ends;
foo = foo -> next) {
-#if defined (FAILOVER_PROTOCOL)
+#if !defined (FAILOVER_PROTOCOL)
if (foo -> on_expiry)
#endif
install = foo;
/* Return zero if we didn't commit the lease to permanent storage;
nonzero if we did. */
- return commit && write_lease (comp) && commit_leases ();
+ return commit && write_lease (comp) && commit_leases ()
+#if defined (FAILOVER_PROTOCOL)
+ && dhcp_failover_queue_update (comp)
+#endif
+ ;
}
/* Release the specified lease and re-hash it as appropriate. */
num_written);
}
+ /* XXX Write all the billing classes. */
+
+#if defined (FAILOVER_PROTOCOL)
+ /* Write all the failover states. */
+ dhcp_failover_write_all_states ();
+#endif
+
/* Write all the leases. */
num_written = 0;
for (s = shared_networks; s; s = s -> next) {