diff options
author | Shawn Routhier <sar@isc.org> | 2012-06-06 23:55:01 +0000 |
---|---|---|
committer | Shawn Routhier <sar@isc.org> | 2012-06-06 23:55:01 +0000 |
commit | 6980ae03c3b877d07557479b93d2276ab49560ac (patch) | |
tree | 31feb0a993bef2c7f14b71c2e0a3936875f3edd3 | |
parent | 35de6c8c24b53adab2e69456373aecbecbe54a95 (diff) | |
download | isc-dhcp-6980ae03c3b877d07557479b93d2276ab49560ac.tar.gz |
The 'no available billing' log line now also logs the name of the last
matching billing class tried before failing to provide a billing.
ISC-Bugs #21759]
-rw-r--r-- | RELNOTES | 7 | ||||
-rw-r--r-- | server/dhcp.c | 21 |
2 files changed, 21 insertions, 7 deletions
@@ -39,8 +39,7 @@ 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 <dhcp-users@isc.org>. - Changes since 4.2.x -<list of changes for 4.3 not in any 4.2.x - remove this line when done> + Changes since 4.2.0 (new features) - If a client renews before 'dhcp-cache-threshold' percent of its lease has elapsed (default 25%), the server will reuse the allocated lease @@ -49,6 +48,10 @@ work on other platforms. Please report any problems and suggested fixes to to perform an fsync() operation on the lease database before reply, which improves performance. [ISC-Bugs #22228] +- The 'no available billing' log line now also logs the name of the last + matching billing class tried before failing to provide a billing. + [ISC-Bugs #21759] + Changes since 4.2.4 - Correct code to calculate timing values in client to compare diff --git a/server/dhcp.c b/server/dhcp.c index 6ef2e4ad..58072c93 100644 --- a/server/dhcp.c +++ b/server/dhcp.c @@ -1887,26 +1887,37 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp) /* If we don't have an active billing, see if we need one, and if we do, try to do so. */ if (lease->billing_class == NULL) { + char *cname = ""; int bill = 0; + for (i = 0; i < packet->class_count; i++) { - if (packet->classes[i]->lease_limit) { + struct class *billclass, *subclass; + + billclass = packet->classes[i]; + if (billclass->lease_limit) { bill++; - if (bill_class(lease, - packet->classes[i])) + if (bill_class(lease, billclass)) break; + + subclass = billclass->superclass; + if (subclass == NULL) + cname = subclass->name; + else + cname = billclass->name; } } if (bill != 0 && i == packet->class_count) { log_info("%s: no available billing: lease " "limit reached in all matching " - "classes", msg); + "classes (last: '%s')", msg, cname); free_lease_state(state, MDL); if (host) host_dereference(&host, MDL); return; } - /* If this is an offer, undo the billing. We go + /* + * 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 |