--- embedaddon/dhcp/server/dhcpleasequery.c 2012/02/21 22:30:18 1.1 +++ embedaddon/dhcp/server/dhcpleasequery.c 2012/10/09 09:06:55 1.1.1.1 @@ -1,4 +1,5 @@ /* + * Copyright (C) 2012 by Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2006-2007 by Internet Systems Consortium, Inc. ("ISC") * * Permission to use, copy, modify, and distribute this software for any @@ -454,10 +455,7 @@ dhcpleasequery(struct packet *packet, int ms_nulltp) { (lease_duration / 8); if (time_renewal > cur_time) { - if (time_renewal < cur_time) - time_renewal = 0; - else - time_renewal = htonl(time_renewal - cur_time); + time_renewal = htonl(time_renewal - cur_time); if (!add_option(options, DHO_DHCP_RENEWAL_TIME, @@ -487,15 +485,8 @@ dhcpleasequery(struct packet *packet, int ms_nulltp) { } if (lease->ends > cur_time) { - if (time_expiry < cur_time) { - log_error("Impossible condition at %s:%d.", - MDL); - - option_state_dereference(&options, MDL); - lease_dereference(&lease, MDL); - return; - } time_expiry = htonl(lease->ends - cur_time); + if (!add_option(options, DHO_DHCP_LEASE_TIME, &time_expiry,