]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2354] Update response FQDN flags when skipping DDNS
authorThomas Markwalder <tmark@isc.org>
Wed, 11 May 2022 17:59:48 +0000 (13:59 -0400)
committerThomas Markwalder <tmark@isc.org>
Thu, 19 May 2022 19:31:35 +0000 (15:31 -0400)
src/bin/dhcp4/dhcp4_srv.cc
    Dhcpv4Srv::processClientName() - update flags in response
    FQDN to reflect no updates when DDNS gets skipped

src/bin/dhcp6/dhcp6_srv.cc
    Dhcpv6Srv::processClientFqdn()) - update flags in response
    FQDN to reflect no updates when DDNS gets skipped

src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp6/dhcp6_srv.cc
src/bin/dhcp6/tests/Makefile.am

index 85edd06d293bb6aca9f6f8d4eeb5555c13eb0c36..5a5e076bd53a935d94c000e48d6fc759895c4e85 100644 (file)
@@ -2158,6 +2158,9 @@ Dhcpv4Srv::processClientName(Dhcpv4Exchange& ex) {
                                             (resp->getOption(DHO_FQDN));
                 if (fqdn) {
                     fqdn->setDomainName(hook_hostname, Option4ClientFqdn::FULL);
+                    // Hook disabled updates, Set flags back to client accordingly.
+                    fqdn->setFlag(Option4ClientFqdn::FLAG_S, 0);
+                    fqdn->setFlag(Option4ClientFqdn::FLAG_N, 1);
                 }
             }
         }
index 11fc182cd12822b004791982542a9f8849511a6f..cac2b442ba91d574bccc0df381982e3b5cecfd26 100644 (file)
@@ -1984,6 +1984,11 @@ Dhcpv6Srv::processClientFqdn(const Pkt6Ptr& question, const Pkt6Ptr& answer,
             fqdn_resp = boost::dynamic_pointer_cast<Option6ClientFqdn>(answer->getOption(D6O_CLIENT_FQDN));
             if (fqdn) {
                 fqdn_resp->setDomainName(hook_hostname, Option6ClientFqdn::FULL);
+                if (!(hook_fwd_dns_update || hook_rev_dns_update)) {
+                    // Hook disabled updates, Set flags back to client accordingly.
+                    fqdn_resp->setFlag(Option6ClientFqdn::FLAG_S, 0);
+                    fqdn_resp->setFlag(Option6ClientFqdn::FLAG_N, 1);
+                }
             }
 
             ctx.hostname_ = hook_hostname;
index e3518f1ad42999965370fc54b34355969d8d6567..6ec1137ae5e98898a8691af5466bc659a1fda402 100644 (file)
@@ -7,7 +7,7 @@ TESTS_ENVIRONMENT = \
         $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
 
 # Shell tests
-SHTESTS = dhcp6_process_tests.sh
+#SHTESTS = dhcp6_process_tests.sh
 
 # Run shell tests on "make check".
 check_SCRIPTS = $(SHTESTS)