]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Corrections to [ISC-Bugs #15429] after bugfixing and incremental review;
authorDavid Hankins <dhankins@isc.org>
Fri, 30 Sep 2005 18:05:35 +0000 (18:05 +0000)
committerDavid Hankins <dhankins@isc.org>
Fri, 30 Sep 2005 18:05:35 +0000 (18:05 +0000)
atsfp was not being cleared on expired leases.

server/confpars.c
server/dhcp.c
server/failover.c
server/mdb.c

index 205f4d6b6409515c43675bad1c0db97992c26bde..f7ed133a15737f787cd7fd39f8e3180c7d21490d 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: confpars.c,v 1.143.2.26 2005/09/22 16:19:58 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: confpars.c,v 1.143.2.27 2005/09/30 18:05:34 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -2568,6 +2568,7 @@ int parse_lease_declaration (struct lease **lp, struct parse *cfile)
                      case TIMESTAMP:
                      case TSTP:
                      case TSFP:
+                     case ATSFP:
                      case CLTT:
                        t = parse_date (cfile);
                        switch (token) {
index e96f2140dd68b26b293f3e3671e4ce3cc079371c..4b340f7ec2aff164aebfa91a6284bf957e14aaf5 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.192.2.54 2005/09/30 17:43:49 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.192.2.55 2005/09/30 18:05:34 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -1999,6 +1999,7 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
 
                        /* Copy previous lease failover ack-state. */
                        lt->tsfp = lease->tsfp;
+                       lt->atsfp = lease->atsfp;
 
                        /* Update Client Last Transaction Time. */
                        lt->cltt = cur_time;
index 8ab2f33f61d25a32bb3f89ed08f4e06685dea476..f09666861472c63c4d767519c405daf955bf6ad8 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: failover.c,v 1.53.2.41 2005/09/30 17:51:04 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: failover.c,v 1.53.2.42 2005/09/30 18:05:35 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -4495,7 +4495,7 @@ isc_result_t dhcp_failover_process_bind_update (dhcp_failover_state_t *state,
                        goto bad;
                }
                if (msg -> chaddr.count > sizeof lt -> hardware_addr.hbuf) {
-                       message = "chaddr to long";
+                       message = "chaddr too long";
                        goto bad;
                }
                lt -> hardware_addr.hlen = msg -> chaddr.count;
index 4b97c15aee3f482fde9bacd80f9b9670c19a6e34..78bd4d726dc91a9dd21c132706b3d9f0032da2b4 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: mdb.c,v 1.67.2.23 2005/09/22 16:19:59 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: mdb.c,v 1.67.2.24 2005/09/30 18:05:35 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -964,16 +964,21 @@ int supersede_lease (comp, lease, commit, propogate, pimmediate)
        comp->cltt = lease->cltt;
        comp->tstp = lease->tstp;
        comp->tsfp = lease->tsfp;
-       /* If this lease update is transmitted, reduce atsfp to zero. */
-       if (propogate)
-               comp->atsfp = 0;
-       else
-               comp->atsfp = lease->atsfp;
+       comp->atsfp = lease->atsfp;
 #endif /* FAILOVER_PROTOCOL */
        comp->ends = lease->ends;
        comp->next_binding_state = lease->next_binding_state;
 
       just_move_it:
+#if defined (FAILOVER_PROTOCOL)
+       /* Atsfp should be cleared upon any state change that implies
+        * propogation wether supersede_lease was given a copy lease
+        * structure or not (often from the pool_timer()).
+        */
+       if (propogate)
+               comp->atsfp = 0;
+#endif /* FAILOVER_PROTOCOL */
+
        if (!comp -> pool) {
                log_error ("Supersede_lease: lease %s with no pool.",
                           piaddr (comp -> ip_addr));