]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1672] Addressed review comments
authorThomas Markwalder <tmark@isc.org>
Tue, 16 Feb 2021 12:10:26 +0000 (07:10 -0500)
committerThomas Markwalder <tmark@isc.org>
Tue, 16 Feb 2021 12:10:26 +0000 (07:10 -0500)
ChangeLog
    Added configuration change notice

src/bin/dhcp4/dhcp4_srv.cc
    Dhcpv4Srv::setFixedFields - added commentary and
    use of IPV4_ZERO_ADDRESS

ChangeLog
src/bin/dhcp4/dhcp4_srv.cc

index cf847e772b85a14f05fbd68ad8f48467384957d4..614348251a65afef715f75a1e308f15fb7610c83 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,10 @@
-1861   [bug]*          tmark
+1861.  [bug]*          tmark
        kea-dhcp4 now uses the value for each fixed field (e.g. next-server,
        server-hostname, boot-file-name) from the first class in query's
        list of classes that specifies the field. Prior to this it used
-       the value from the last class which specified the field.
+       the value from the last class which specified the field. It may
+       be necessary to revise existing configurations to get the desired
+       values.
        (Gitlab #1672)
 
 Kea 1.9.4 (development) released on Jan 27, 2021
index a4bdfc4014dcb86e064a6c37310b0e0a2fe82b6d..2038d2941a458797c37445afec3dc411f5e7c429 100644 (file)
@@ -2918,11 +2918,12 @@ Dhcpv4Srv::setFixedFields(Dhcpv4Exchange& ex) {
 
         // Now we need to iterate over the classes assigned to the
         // query packet and find corresponding class definitions for it.
-        // We want the first value found for each field.
-        IOAddress next_server("0.0.0.0");
+        // We want the first value found for each field.  We track how
+        // many we've found so we can stop if we have all three.
+        IOAddress next_server = IOAddress::IPV4_ZERO_ADDRESS();
         string sname;
         string filename;
-        size_t found_cnt = 0;
+        size_t found_cnt = 0;  // How many fields we have found.
         for (ClientClasses::const_iterator name = classes.cbegin();
              name != classes.cend() && found_cnt < 3; ++name) {