From: David Hankins Date: Thu, 15 Jun 2006 17:52:06 +0000 (+0000) Subject: - A bug where leases not in ACTIVE state would get billed to billed classes X-Git-Tag: DHCPv6_parsing_base~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1b2ab55fddbf8eb48679f8512c7b066167e6f59e;p=thirdparty%2Fdhcp.git - A bug where leases not in ACTIVE state would get billed to billed classes (classes with lease limitations) was fixed. Non-active leases OFFERed to clients are no longer billed (but billing is checked before offering). [ISC-Bugs #16168] --- diff --git a/RELNOTES b/RELNOTES index 93e61bcc9..5bfc9406e 100644 --- a/RELNOTES +++ b/RELNOTES @@ -123,6 +123,10 @@ and for prodding me into improving it. misapplied to server values rather than client values. The server no longer advertises 8-byte lease-time options when on 64-bit platforms. +- A bug where leases not in ACTIVE state would get billed to billed classes + (classes with lease limitations) was fixed. Non-active leases OFFERed + to clients are no longer billed (but billing is checked before offering). + Changes since 3.0.4rc1 - The dhcp-options.5 manpage was updated to correct indentation errors diff --git a/server/dhcp.c b/server/dhcp.c index 354eb8664..0b89dca32 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.204 2006/06/01 20:23:17 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.205 2006/06/15 17:52:06 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1920,6 +1920,19 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp) return; } } + + /* If this is an offer, undo the billing. We go + * through all the steps above to bill a class so + * we can hit the 'no available billing' mark and + * abort without offering. But it just doesn't make + * sense to permanently bill a class for a non-active + * lease. This means on REQUEST, we will bill this + * lease again (if there is a REQUEST). + */ + if (offer == DHCPOFFER && + lease->billing_class != NULL && + lease->state != FTS_ACTIVE) + unbill_class(lease, lease->billing_class); } }