]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Don't include lease time information in the response to a DHCPINFORM
authorShawn Routhier <sar@isc.org>
Tue, 20 Apr 2010 23:30:20 +0000 (23:30 +0000)
committerShawn Routhier <sar@isc.org>
Tue, 20 Apr 2010 23:30:20 +0000 (23:30 +0000)
request.  We do this by removing any time information from the option
cache before building the reponse packet.  Bug ticket 21092.

RELNOTES
common/options.c
server/dhcp.c

index b99cabf9d44f05838ecc74e5197f53f67bf72823..bc1b27742099cfe7ca6f3a6fab80f8f730d90b96 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -39,6 +39,11 @@ The system has only been tested on Linux, FreeBSD, and Solaris, and may not
 work on other platforms. Please report any problems and suggested fixes to
 <dhcp-users@isc.org>.
 
+                       Changes since 4.2.0b1
+
+- Prohibit including lease time information in a response to a DHCP INFORM
+  Bug ticket 21092.
+
                        Changes since 4.2.0a2
 
 - Update the fsync code to work with the changes to the DDNS code.  It now
index 0f28f6c94184cdbcb768380448b77cf933c98065..28c36e6be1be49c108a83dadba52a5a1f4c452b6 100644 (file)
@@ -637,6 +637,8 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket,
        /*
         * Preload the option priority list with protocol-mandatory options.
         * This effectively gives these options the highest priority.
+        * This provides the order for any available options, the option
+        * must be in the option cache in order to actually be included.
         */
        priority_len = 0;
        priority_list[priority_len++] = DHO_DHCP_MESSAGE_TYPE;
index 7a01c3c9be68516482f01755e62e0c17a4d8f23f..9e83983584579b11ce5ca55b4bb236cc00bf0db0 100644 (file)
@@ -1222,6 +1222,13 @@ void dhcpinform (packet, ms_nulltp)
                }
        }
 
+       /*
+        * Remove any time options, per section 3.4 RFC 2131
+        */
+       delete_option(&dhcp_universe, options, DHO_DHCP_LEASE_TIME);
+       delete_option(&dhcp_universe, options, DHO_DHCP_RENEWAL_TIME);
+       delete_option(&dhcp_universe, options, DHO_DHCP_REBINDING_TIME);
+
        /* Set up the option buffer... */
        outgoing.packet_length =
                cons_options (packet, outgoing.raw, (struct lease *)0,