]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Fix a couple of problems with the ack and update queue code.
authorTed Lemon <source@isc.org>
Mon, 12 Jun 2000 20:19:21 +0000 (20:19 +0000)
committerTed Lemon <source@isc.org>
Mon, 12 Jun 2000 20:19:21 +0000 (20:19 +0000)
server/failover.c

index 82715141ea76f793d03b12d5cb73fdc62e6839c4..11a78af4f9b6c3a8637dcaab145489c1bb8838a9 100644 (file)
@@ -43,7 +43,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: failover.c,v 1.18 2000/06/08 21:29:02 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: failover.c,v 1.19 2000/06/12 20:19:21 mellon Exp $ Copyright (c) 1999-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1585,10 +1585,6 @@ int dhcp_failover_queue_update (struct lease *lease, int immediate)
                dhcp_failover_ack_queue_remove (state, lease);
 
        if (state -> update_queue_head) {
-               if (state -> update_queue_tail -> next_pending)
-                       lease_dereference
-                               (&state -> update_queue_tail -> next_pending,
-                                MDL);
                lease_reference (&state -> update_queue_tail -> next_pending,
                                 lease, MDL);
                lease_dereference (&state -> update_queue_tail, MDL);
@@ -1607,6 +1603,9 @@ void dhcp_failover_ack_queue_remove (dhcp_failover_state_t *state,
 {
        struct lease *lp;
 
+       if (!(lease -> flags & ON_ACK_QUEUE))
+               return;
+
        if (state -> ack_queue_head == lease) {
                lease_dereference (&state -> ack_queue_head, MDL);
                if (lease -> next_pending) {