]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
- The server was inappropriately sending leases to the RESET state in the
authorDavid Hankins <dhankins@isc.org>
Fri, 6 Jan 2006 22:09:23 +0000 (22:09 +0000)
committerDavid Hankins <dhankins@isc.org>
Fri, 6 Jan 2006 22:09:23 +0000 (22:09 +0000)
  event that multiple active leases were found to match a singly-identified
  client.  This was changed to RELEASED (by accepting a different, ACTIVE
  binding, the client is implicitly releasing its lease).  This repairs a
  bug wherein secondary servers in failover pairs detecting this condition
  move leases to RESET, and primaries refuse to accept that state
  transition (properly). [ISC-Bugs #15718]

RELNOTES
server/dhcp.c

index cad4ed3ba7dcb63c26e5476bdf37db1c0b7d870f..61a867b6eee486c8ba7494bfc574c3205e29d27f 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -54,6 +54,14 @@ and for prodding me into improving it.
   messages also log the 'effective client ip address' rather than the
   client's supplied ciaddr (since some clients produce null ciaddrs).
 
+- The server was inappropriately sending leases to the RESET state in the
+  event that multiple active leases were found to match a singly-identified
+  client.  This was changed to RELEASED (by accepting a different, ACTIVE
+  binding, the client is implicitly releasing its lease).  This repairs a
+  bug wherein secondary servers in failover pairs detecting this condition
+  move leases to RESET, and primaries refuse to accept that state
+  transition (properly).
+
                        Changes since 3.0.4b1
 
 - Command line parsing in omshell was repaired - it no longer closes
index 58e924a2d60c2b4b631ae9a33170207b3f5f6be1..6c3c31515228647ccb15d8721728b4905b85ab65 100644 (file)
@@ -34,7 +34,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: dhcp.c,v 1.192.2.58 2006/01/06 22:07:11 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
+"$Id: dhcp.c,v 1.192.2.59 2006/01/06 22:09:23 dhankins Exp $ Copyright (c) 2004-2005 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -3335,7 +3335,7 @@ int find_lease (struct lease **lp,
                                    (share ==
                                     uid_lease -> subnet -> shared_network) &&
                                    packet -> packet_type == DHCPREQUEST)
-                                       dissociate_lease (uid_lease);
+                                       release_lease (uid_lease, packet);
                            }
                            lease_dereference (&uid_lease, MDL);
                            lease_reference (&uid_lease, ip_lease, MDL);
@@ -3405,8 +3405,10 @@ int find_lease (struct lease **lp,
              permitted (packet, ip_lease -> pool -> prohibit_list)) ||
             (ip_lease -> pool -> permit_list &&
              !permitted (packet, ip_lease -> pool -> permit_list)))) {
-               if (!packet -> raw -> ciaddr.s_addr)
+               if (!packet->raw->ciaddr.s_addr &&
+                   (ip_lease->binding_state == FTS_ACTIVE))
                        release_lease (ip_lease, packet);
+
                lease_dereference (&ip_lease, MDL);
        }
 
@@ -3483,10 +3485,18 @@ int find_lease (struct lease **lp,
           the lease that matched the client identifier. */
        if (uid_lease) {
                if (lease) {
+                       log_error("uid lease %s for client %s is duplicate "
+                                 "on %s",
+                                 piaddr(uid_lease->ip_addr),
+                                 print_hw_addr(packet->raw->htype,
+                                               packet->raw->hlen,
+                                               packet->raw->chaddr),
+                                 uid_lease->subnet->shared_network->name);
+
                        if (!packet -> raw -> ciaddr.s_addr &&
                            packet -> packet_type == DHCPREQUEST &&
                            uid_lease -> binding_state == FTS_ACTIVE)
-                               dissociate_lease (uid_lease);
+                               release_lease (uid_lease, packet);
 #if defined (DEBUG_FIND_LEASE)
                        log_info ("not choosing uid lease.");
 #endif