From: Shawn Routhier Date: Tue, 20 Apr 2010 23:20:20 +0000 (+0000) Subject: Don't include lease time information in the response to a DHCPINFORM X-Git-Tag: v4_3_0a1~287 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e05d095c26e721257180c7c82d5f6fa5c07e298;p=thirdparty%2Fdhcp.git Don't include lease time information in the response to a DHCPINFORM request. We do this by removing any time information from the option cache before building the reponse packet. Bug ticket 21092. --- diff --git a/RELNOTES b/RELNOTES index addae6b02..c3b0684f3 100644 --- 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 . + 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 diff --git a/common/options.c b/common/options.c index 52003ab6f..a566708bb 100644 --- a/common/options.c +++ b/common/options.c @@ -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; diff --git a/server/dhcp.c b/server/dhcp.c index 7a01c3c9b..9e8398358 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -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,