]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
The 'no available billing' log line now also logs the name of the last
authorShawn Routhier <sar@isc.org>
Wed, 6 Jun 2012 23:55:01 +0000 (23:55 +0000)
committerShawn Routhier <sar@isc.org>
Wed, 6 Jun 2012 23:55:01 +0000 (23:55 +0000)
matching billing class tried before failing to provide a billing.
ISC-Bugs #21759]

RELNOTES
server/dhcp.c

index 9bb002213bcfd988f4379a8915495aea1106b82c..061a000fc21a0a1544358e18270416368216a782 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -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
index 6ef2e4ada1ac0749c8a086fe3fe4f8a27facae43..58072c93c3a40ceac07203b54a49036c07c5778f 100644 (file)
@@ -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