]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] Server now permits one UID to hold leases in multiple subnets
authorThomas Markwalder <tmark@isc.org>
Tue, 4 Oct 2016 18:25:25 +0000 (14:25 -0400)
committerThomas Markwalder <tmark@isc.org>
Tue, 4 Oct 2016 18:25:25 +0000 (14:25 -0400)
    Merges in rt41358.

RELNOTES
server/dhcp.c

index 283d5a5e8c3cef8c389584b73805335732ea0c4c..1c0c21e4c229ea52122e2d47733e9367434b3828 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -117,6 +117,15 @@ by Eric Young (eay@cryptsoft.com).
   configure --with-libbind).
   [ISC-Bugs #43285]
 
+- The server now allows the client identifier (option 61) to own leases
+  in more than one subnet concurrently. Prior to this the server would
+  incorrectly release an existing lease in one subnet prior to assigning
+  a lease in another subnet. Note that the prior behavior can be still
+  be achieved by enabling one-lease-per-client. Thanks to both David Zych at
+  the University of Illinois and Norm Proffitt of Infoblox for reporting
+  the issue; and Norm for suggesting a solution.
+  [ISC-Bugs #41358]
+
                        Changes since 4.3.0 (bug fixes)
 
 - Tidy up several small tickets.
index c9b36325c618a580bfec9a4e3fa7c0522a152443..a490f6355d0e909ee499e37d7569e96db548b9ef 100644 (file)
@@ -4152,6 +4152,7 @@ int find_lease (struct lease **lp,
         * preference, so the first one is the best one.
         */
        while (uid_lease) {
+               isc_boolean_t do_release = !packet->raw->ciaddr.s_addr;
 #if defined (DEBUG_FIND_LEASE)
                log_info ("trying next lease matching client id: %s",
                          piaddr (uid_lease -> ip_addr));
@@ -4182,6 +4183,9 @@ int find_lease (struct lease **lp,
                        log_info ("wrong network segment: %s",
                                  piaddr (uid_lease -> ip_addr));
 #endif
+                       /* Allow multiple leases using the same UID
+                          on different subnetworks. */
+                       do_release = ISC_FALSE;
                        goto n_uid;
                }
 
@@ -4197,7 +4201,7 @@ int find_lease (struct lease **lp,
                        if (uid_lease -> n_uid)
                                lease_reference (&next,
                                                 uid_lease -> n_uid, MDL);
-                       if (!packet -> raw -> ciaddr.s_addr)
+                       if (do_release)
                                release_lease (uid_lease, packet);
                        lease_dereference (&uid_lease, MDL);
                        if (next) {