From 6aab3e99a922e268305160480849e47464d8d06e Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Mon, 27 Jan 2025 13:19:33 +0200 Subject: [PATCH] [#3049] fixed empty hostname case --- src/bin/dhcp6/tests/fqdn_unittest.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/dhcp6/tests/fqdn_unittest.cc b/src/bin/dhcp6/tests/fqdn_unittest.cc index 5e0e893654..d795d9e0f8 100644 --- a/src/bin/dhcp6/tests/fqdn_unittest.cc +++ b/src/bin/dhcp6/tests/fqdn_unittest.cc @@ -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, -- 2.47.3