--- /dev/null
+[bug] tmark
+ When generating FQDNs from IP addresses for DDNS,
+ kea-dhcp6 will now append a zero to the end of
+ prefixes that would otherwise end in a hyphen.
+ (Gitlab #3781)
``myhost-3001-1--70E.example.com.``
+As of Kea 2.7.8, generated prefixes that would have ended in a hyphen
+will have a zero appended to the end. For example, the generated prefix
+for the address "2001:db8:1::" would be "myhost-2001-db8-1--0".
+
.. _dhcp6-host-name-sanitization:
Sanitizing Client FQDN Names
std::replace(hostname.begin(), hostname.end(),
(address.isV4() ? '.' : ':'), '-');
+ if (*(hostname.rbegin()) == '-') {
+ hostname.append("0");
+ }
+
std::ostringstream gen_name;
gen_name << ddns_params.getGeneratedPrefix() << "-" << hostname;
return (qualifyName(gen_name.str(), ddns_params, trailing_dot));
EXPECT_EQ("prefix-2001-db8--2.suffix.com.",
mgr.generateFqdn(v6address, *ddns_params_, do_dot));
+ // Verify that it appends a zero when v6 address ends in colon.
+ asiolink::IOAddress v6address2("2001:db8::");
+ EXPECT_EQ("prefix-2001-db8--0.suffix.com.",
+ mgr.generateFqdn(v6address2, *ddns_params_, do_dot));
+
// Create a disabled config.
subnet_->setDdnsSendUpdates(false);