diff options
Diffstat (limited to 'server/dhcpleasequery.c')
-rw-r--r-- | server/dhcpleasequery.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/server/dhcpleasequery.c b/server/dhcpleasequery.c index 3bab7bcd..3d589ecc 100644 --- a/server/dhcpleasequery.c +++ b/server/dhcpleasequery.c @@ -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, |