]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1548] kea-dhcp4 updates host name option after ddns4_update
authorThomas Markwalder <tmark@isc.org>
Thu, 7 Apr 2022 18:47:56 +0000 (14:47 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 21 Apr 2022 14:19:20 +0000 (10:19 -0400)
    ddns-tuning hook no longer updates outbound host option, that
    is now done by kea-dhcp4 when there are changes.

modified:   dhcp4_srv.cc

src/bin/dhcp4/dhcp4_srv.cc

index cc323112bc3b9286e0a08c9f96c2f0d313fb5c68..9abee10b2a80ec96565ab74788a3a3318a26c725 100644 (file)
@@ -2138,6 +2138,13 @@ Dhcpv4Srv::processClientName(Dhcpv4Exchange& ex) {
                 fqdn_fwd = hook_fqdn_fwd;
                 fqdn_rev = hook_fqdn_rev;
 
+                // If there's an outbound host-name option in the response we need to updated it.
+                OptionStringPtr hostname_opt = boost::dynamic_pointer_cast<OptionString>
+                                              (resp->getOption(DHO_HOST_NAME));
+                if (hostname_opt) {
+                    hostname_opt->setValue(hook_hostname);
+                }
+
                 // If there's an outbound FQDN option in the response we need
                 // to update it with the new host name.
                 Option4ClientFqdnPtr fqdn = boost::dynamic_pointer_cast<Option4ClientFqdn>