]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3049] fixed empty hostname case
authorRazvan Becheriu <razvan@isc.org>
Mon, 27 Jan 2025 11:19:33 +0000 (13:19 +0200)
committerRazvan Becheriu <razvan@isc.org>
Mon, 27 Jan 2025 18:30:19 +0000 (18:30 +0000)
src/bin/dhcp6/tests/fqdn_unittest.cc

index 5e0e8936547909361e5794eb9c7031f20102b020..d795d9e0f8ff8fa40f4363e19187bbbf62751019 100644 (file)
@@ -521,7 +521,7 @@ public:
         OptionPtr srvid = srv_->getServerID();
         // Set the appropriate FQDN type. It must be partial if hostname is
         // empty or if it does not end with dot '.'.
-        Option6ClientFqdn::DomainNameType fqdn_type = (hostname.back() != '.' ?
+        Option6ClientFqdn::DomainNameType fqdn_type = ((hostname.empty() || hostname.back() != '.') ?
             Option6ClientFqdn::PARTIAL : Option6ClientFqdn::FULL);
 
         Pkt6Ptr req = generateMessage(msg_type, client_flags,