2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[#1254] Addressed review comments

This commit is contained in:
Thomas Markwalder
2020-08-14 10:37:27 -04:00
committed by Razvan Becheriu
parent bd33d3bbdb
commit f41bac10f4
6 changed files with 10 additions and 11 deletions

View File

@@ -1,8 +1,8 @@
17xx. [bug]* fdupont 17xx. [bug]* fdupont
When a host reservation in a subnet reserves an address, the When a host reservation in a subnet reserves an address, the
address must in the subnet prefix. This check was previously address must be within the subnet. This check was previously
only done by the host command hook library. Note it does not only done by the host command hook library. Note it does not
applies the prefix delegation. apply to prefix delegation.
(Gitlab #1254) (Gitlab #1254)
1787. [bug] razvan 1787. [bug] razvan

View File

@@ -3843,8 +3843,7 @@ DHCPv4 message such as siaddr, sname, or file.
.. note:: .. note::
Beginning with Kea 1.7.11 the reserved address must be in the subnet Beginning with Kea 1.7.11 the reserved address must be within the subnet.
prefix.
The following example shows how to reserve addresses for specific hosts The following example shows how to reserve addresses for specific hosts
in a subnet: in a subnet:

View File

@@ -3356,8 +3356,8 @@ specify a hostname and DHCPv6 options for a given host.
.. note:: .. note::
Beginning with Kea 1.7.11 all reserved addresses must be in the subnet Beginning with Kea 1.7.11 all reserved addresses must be within the subnet.
prefix. This does not apply to reserved prefixes. This does not apply to reserved prefixes.
The following example shows how to reserve addresses and prefixes for The following example shows how to reserve addresses and prefixes for
specific hosts: specific hosts:

View File

@@ -936,7 +936,7 @@ Subnet4ConfigParser::validateResv(const Subnet4Ptr& subnet, ConstHostPtr host) {
const IOAddress& address = host->getIPv4Reservation(); const IOAddress& address = host->getIPv4Reservation();
if (!address.isV4Zero() && !subnet->inRange(address)) { if (!address.isV4Zero() && !subnet->inRange(address)) {
isc_throw(DhcpConfigError, "specified reservation '" << address isc_throw(DhcpConfigError, "specified reservation '" << address
<< "' is not matching the IPv4 subnet prefix '" << "' is not within the IPv4 subnet '"
<< subnet->toText() << "'"); << subnet->toText() << "'");
} }
} }
@@ -1346,7 +1346,7 @@ Subnet6ConfigParser::validateResvs(const Subnet6Ptr& subnet, ConstHostPtr host)
const IOAddress& address = it->second.getPrefix(); const IOAddress& address = it->second.getPrefix();
if (!subnet->inRange(address)) { if (!subnet->inRange(address)) {
isc_throw(DhcpConfigError, "specified reservation '" << address isc_throw(DhcpConfigError, "specified reservation '" << address
<< "' is not matching the IPv6 subnet prefix '" << "' is not within the IPv6 subnet '"
<< subnet->toText() << "'"); << subnet->toText() << "'");
} }
} }

View File

@@ -1953,8 +1953,8 @@ TEST(CfgSubnets4Test, outOfRangeHost) {
<< "invalid JSON:" << json << "\n test is broken"; << "invalid JSON:" << json << "\n test is broken";
Subnet4ConfigParser parser; Subnet4ConfigParser parser;
std::string msg = "specified reservation '10.2.2.1' is not matching "; std::string msg = "specified reservation '10.2.2.1' is not within ";
msg += "the IPv4 subnet prefix '10.1.2.0/24'"; msg += "the IPv4 subnet '10.1.2.0/24'";
EXPECT_THROW_MSG(parser.parse(elems), DhcpConfigError, msg); EXPECT_THROW_MSG(parser.parse(elems), DhcpConfigError, msg);
} }

View File

@@ -1830,7 +1830,7 @@ TEST(CfgSubnets6Test, outOfRangeHost) {
Subnet6ConfigParser parser; Subnet6ConfigParser parser;
std::string msg = "specified reservation '2001:db8:2::1' is "; std::string msg = "specified reservation '2001:db8:2::1' is ";
msg += "not matching the IPv6 subnet prefix '2001:db8:1::/48'"; msg += "not within the IPv6 subnet '2001:db8:1::/48'";
EXPECT_THROW_MSG(parser.parse(elems), DhcpConfigError, msg); EXPECT_THROW_MSG(parser.parse(elems), DhcpConfigError, msg);
} }