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 /server/dhcp.c | |
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]
Diffstat (limited to 'server/dhcp.c')
-rw-r--r-- | server/dhcp.c | 21 |
1 files changed, 16 insertions, 5 deletions
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 |