]> 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:20:20 +0000 (23:20 +0000)
committerShawn Routhier <sar@isc.org>
Tue, 20 Apr 2010 23:20:20 +0000 (23:20 +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 addae6b027581224b98e465a600a97a5766fc535..c3b0684f3381167ebb1ded2579547c0701e37731 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 52003ab6f070da4fe9cee4a7a2308998c5fc635c..a566708bbf8f59c104561ff378a69c9a43b8d56a 100644 (file)
@@ -3,7 +3,7 @@
    DHCP options parsing and reassembly. */
 
 /*
- * Copyright (c) 2004-2009 by Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (c) 2004-2010 by Internet Systems Consortium, Inc. ("ISC")
  * Copyright (c) 1995-2003 by Internet Software Consortium
  *
  * Permission to use, copy, modify, and distribute this software for any
@@ -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,