|
@@ -278,9 +278,12 @@ RadiusHostDataSource::getAll(const Host::IdentifierType& identifier_type,
|
|
|
host->addReservation(ipv6_addr);
|
|
|
}
|
|
|
if (std::string(name) == "Delegated-IPv6-Prefix") {
|
|
|
- fprintf(stderr, "Delegated-IPv6-Prefix: %s", value);
|
|
|
- /* TODO: parse prefix length. */
|
|
|
- IPv6Resrv ipv6_prefix(IPv6Resrv::TYPE_PD, asiolink::IOAddress(value), 42);
|
|
|
+ /* Split "prefix/prefixlen" appropriately */
|
|
|
+ std::string value_str(value);
|
|
|
+ size_t pos = value_str.find('/');
|
|
|
+ asiolink::IOAddress prefix(value_str.substr(0, pos));
|
|
|
+ uint8_t prefixlen = std::stoi(value_str.substr(pos + 1));
|
|
|
+ IPv6Resrv ipv6_prefix(IPv6Resrv::TYPE_PD, prefix, prefixlen);
|
|
|
host->addReservation(ipv6_prefix);
|
|
|
}
|
|
|
}
|