]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[#13,!7] Corrected a backwards check in billing class logic
authorThomas Markwalder <tmark@isc.org>
Tue, 7 May 2019 19:36:54 +0000 (15:36 -0400)
committerThomas Markwalder <tmark@isc.org>
Fri, 7 Jun 2019 15:47:50 +0000 (11:47 -0400)
RELNOTES - added a release note.

server/dhcp.c
    ack_lease () - corrected the logic used to capture the billing
    class name for logging

RELNOTES
server/dhcp.c

index 1ada18dc953f79409cb8978dfcaf27b279942f98..e7790ea23fa5ca8c781c61c7b6e71aaa00218a98 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -129,6 +129,10 @@ by Eric Young (eay@cryptsoft.com).
   update ability (e.g. by undefining NSUPDATE).
   [ISC-Bugs, #16,!9 git ddb508ac083dae4ff83279dd240bad7f73a97b7d]
 
+- Corrected an issue that was causing the server, when running in
+  DHPCv4 mode, to segfault when class lease limits are reached.
+  [ISC-Bugs #13, !7  git #TBD]
+
                Changes since 4.4.0 (New Features)
 - none
                Changes since 4.4.0 (Bug Fixes)
index 0529662c89b33307d7eccc58f1d00bdb07817f13..6d129ec97180c76b77ae78f3182789ffc60e775b 100644 (file)
@@ -2562,7 +2562,7 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
                        int bill = 0;
 
                        for (i = 0; i < packet->class_count; i++) {
-                               struct class *billclass, *subclass;
+                               struct class *billclass, *superclass;
 
                                billclass = packet->classes[i];
                                if (billclass->lease_limit) {
@@ -2570,9 +2570,9 @@ void ack_lease (packet, lease, offer, when, msg, ms_nulltp, hp)
                                        if (bill_class(lease, billclass))
                                                break;
 
-                                       subclass = billclass->superclass;
-                                       if (subclass == NULL)
-                                               cname = subclass->name;
+                                       superclass = billclass->superclass;
+                                       if (superclass != NULL)
+                                               cname = superclass->name;
                                        else
                                                cname = billclass->name;
                                }