isc_throw(isc::BadValue, "invalid prefix length '"
<< static_cast<int>(prefix_len)
<< "' for reserved IPv6 address, expected 128");
- } else if ((type == TYPE_PD) && (prefix_len != 128)) {
+ }
+ /* uncomment if strict prefix and prefix length is required. see #2943
+ else if ((type == TYPE_PD) && (prefix_len != 128)) {
IOAddress first_address = firstAddrInPrefix(prefix, prefix_len);
if (first_address != prefix) {
isc_throw(BadValue, "Invalid host address boundaries: " << prefix
<< "/" << static_cast<uint32_t>(prefix_len));
}
}
+ */
type_ = type;
prefix_ = prefix;
if (prefixlen != 128) {
if (type != Lease::TYPE_PD) {
isc_throw(BadValue, "prefixlen must be 128 for non prefix type");
- } else {
+ }
+ /* uncomment if strict prefix and prefix length is required. see #2943
+ else {
IOAddress first_address = firstAddrInPrefix(addr, prefixlen);
if (first_address != addr) {
isc_throw(BadValue, "Invalid lease address boundaries: " << addr
<< "/" << static_cast<uint32_t>(prefixlen));
}
}
+ */
}
cltt_ = time(NULL);
if (prefixlen != 128) {
if (type != Lease::TYPE_PD) {
isc_throw(BadValue, "prefixlen must be 128 for non prefix type");
- } else {
+ }
+ /* uncomment if strict prefix and prefix length is required. see #2943
+ else {
IOAddress first_address = firstAddrInPrefix(addr, prefixlen);
if (first_address != addr) {
isc_throw(BadValue, "Invalid lease address boundaries: " << addr
<< "/" << static_cast<uint32_t>(prefixlen));
}
}
+ */
}
cltt_ = time(NULL);
EXPECT_THROW_MSG(IPv6Resrv(IPv6Resrv::TYPE_NA,
IOAddress("2001:db8:1::"), 64),
isc::BadValue, expected);
-
+ /* uncomment if strict prefix and prefix length is required. see #2943
// Check for extra specified bits in prefix.
expected = "Invalid host address boundaries: 2001:db8:1:: is not the first "
"address in prefix: 2001:db8::/32";
EXPECT_THROW_MSG(IPv6Resrv(IPv6Resrv::TYPE_PD,
IOAddress("2001:db8:1::"), 32),
isc::BadValue, expected);
+ */
}
// This test verifies that it is possible to modify prefix and its
EXPECT_THROW_MSG(resrv.set(IPv6Resrv::TYPE_PD,
IOAddress("2001:db8:1::"), 129),
isc::BadValue, expected);
-
+ /* uncomment if strict prefix and prefix length is required. see #2943
// Check for extra specified bits in prefix.
expected = "Invalid host address boundaries: 2001:db8:1:: is not the first "
"address in prefix: 2001:db8::/32";
EXPECT_THROW_MSG(resrv.set(IPv6Resrv::TYPE_PD,
IOAddress("2001:db8:1::"), 32),
isc::BadValue, expected);
+ */
}
// This test checks that the equality operators work fine.
subnet_id, true, true, "", HWAddrPtr())),
BadValue, "DUID is mandatory for an IPv6 lease");
+ /* uncomment if strict prefix and prefix length is required. see #2943
// Lease6 must have a valid prefix and prefix length.
addr = IOAddress(ADDRESS[5]);
EXPECT_THROW_MSG(lease2.reset(new Lease6(Lease::TYPE_PD, addr,
subnet_id, true, true, "", HWAddrPtr(), 16)),
BadValue, "Invalid lease address boundaries: 8000::1 is not "
"the first address in prefix: 8000::/16");
+ */
// Lease6 must have a prefixlen set to 128 for non prefix type.
addr = IOAddress(ADDRESS[4]);