]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[master] DHCPINFORM response now includes options down to the pool scope
authorThomas Markwalder <tmark@isc.org>
Tue, 1 Nov 2016 18:05:24 +0000 (14:05 -0400)
committerThomas Markwalder <tmark@isc.org>
Tue, 1 Nov 2016 18:05:24 +0000 (14:05 -0400)
    Merges in rt43219.

RELNOTES
server/dhcp.c

index 1e3b124ede244dabe3dff5ed651a59c12f80e0b7..6f6e274b6c0632b0db545112a0fb06a721a6da4b 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -140,6 +140,12 @@ by Eric Young (eay@cryptsoft.com).
   section in the README file for the recommended procedure.
   [ISC-Bugs #29402]
 
+- When replying to a DHCPINFORM, the server will now include options specified
+  at the pool scope, provided the ciaddr field of the DHCPINFORM is populated.
+  Prior to this the server only evaluated options down to the subnet scope.
+  Thanks to Fernando Soto at BlueCat Networks for reporting the issue.
+  [ISC-Bugs #43219]
+
                        Changes since 4.3.0 (bug fixes)
 
 - Tidy up several small tickets.
index a490f6355d0e909ee499e37d7569e96db548b9ef..af45658064ecdacd0fcbc73aba6fc798d651b003 100644 (file)
@@ -1085,6 +1085,7 @@ void dhcpinform (packet, ms_nulltp)
 #if defined (DEBUG_INFORM_HOST)
        int h_w_fixed_addr = 0;
 #endif
+       struct lease* cip_lease = NULL;
 
        /* The client should set ciaddr to its IP address, but apparently
           it's common for clients not to do this, so we'll use their IP
@@ -1231,11 +1232,23 @@ void dhcpinform (packet, ms_nulltp)
 
        maybe_return_agent_options(packet, options);
 
-       /* Execute statements in scope starting with the subnet scope. */
+       /* If we have ciaddr, find its lease so we can find its pool. */
+       if (zeroed_ciaddr == ISC_FALSE) {
+               find_lease_by_ip_addr (&cip_lease, cip, MDL);
+       }
+
+       /* Execute statements starting at the pool scope if we can
+        * otherwise the subnet scope is a far as we can go. */
        execute_statements_in_scope(NULL, packet, NULL, NULL,
                                    packet->options, options,
-                                   &global_scope, subnet->group,
+                                   &global_scope,
+                                   (cip_lease != NULL &&
+                                    cip_lease->pool != NULL ?
+                                    cip_lease->pool->group : subnet->group),
                                    NULL, NULL);
+       if (cip_lease) {
+               lease_dereference (&cip_lease, MDL);
+       }
                
        /* Execute statements in the class scopes. */
        for (i = packet->class_count; i > 0; i--) {