From: Thomas Markwalder Date: Tue, 16 Feb 2021 12:10:26 +0000 (-0500) Subject: [#1672] Addressed review comments X-Git-Tag: Kea-1.9.5~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b1a9a282b25a393a8eeeb33ae07379fee246e95;p=thirdparty%2Fkea.git [#1672] Addressed review comments ChangeLog Added configuration change notice src/bin/dhcp4/dhcp4_srv.cc Dhcpv4Srv::setFixedFields - added commentary and use of IPV4_ZERO_ADDRESS --- diff --git a/ChangeLog b/ChangeLog index cf847e772b..614348251a 100644 --- 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 diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index a4bdfc4014..2038d2941a 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -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) {