diff options
author | David Hankins <dhankins@isc.org> | 2006-06-15 17:53:51 +0000 |
---|---|---|
committer | David Hankins <dhankins@isc.org> | 2006-06-15 17:53:51 +0000 |
commit | ecb5fb333540f86527503cf5a53be0492b298c5b (patch) | |
tree | c08ad221e0eb0d2c70c48d1f272870c073097084 | |
parent | e3a153b26f98eb3ce85ec2ecb45426cfcecc7609 (diff) | |
download | isc-dhcp-ecb5fb333540f86527503cf5a53be0492b298c5b.tar.gz |
- 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]
-rw-r--r-- | RELNOTES | 4 | ||||
-rw-r--r-- | server/dhcp.c | 15 |
2 files changed, 18 insertions, 1 deletions
@@ -98,6 +98,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 a0cae37b..0c9a81ae 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -34,7 +34,7 @@ #ifndef lint static char copyright[] = -"$Id: dhcp.c,v 1.192.2.62 2006/05/17 20:16:59 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; +"$Id: dhcp.c,v 1.192.2.63 2006/06/15 17:53:51 dhankins Exp $ Copyright (c) 2004-2006 Internet Systems Consortium. All rights reserved.\n"; #endif /* not lint */ #include "dhcpd.h" @@ -1906,6 +1906,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); } } |