summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/cfg_hosts.cc
diff options
context:
space:
mode:
authorFrancis Dupont <fdupont@isc.org>2023-01-25 16:04:13 +0100
committerFrancis Dupont <fdupont@isc.org>2023-02-07 13:01:29 +0100
commit81a5c85d72c7c1b6f9e99caf1e661dd8349fb019 (patch)
tree5c6f7d1ae6adabf82b37959e9906ef7088a42e1c /src/lib/dhcpsrv/cfg_hosts.cc
parent[#2682] Addressed comments (diff)
downloadkea-81a5c85d72c7c1b6f9e99caf1e661dd8349fb019.tar.xz
kea-81a5c85d72c7c1b6f9e99caf1e661dd8349fb019.zip
[#2723] Removed check
Diffstat (limited to 'src/lib/dhcpsrv/cfg_hosts.cc')
-rw-r--r--src/lib/dhcpsrv/cfg_hosts.cc27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/lib/dhcpsrv/cfg_hosts.cc b/src/lib/dhcpsrv/cfg_hosts.cc
index 362767d86e..d317e11146 100644
--- a/src/lib/dhcpsrv/cfg_hosts.cc
+++ b/src/lib/dhcpsrv/cfg_hosts.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2023 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -977,31 +977,6 @@ CfgHosts::add4(const HostPtr& host) {
HWAddrPtr hwaddr = host->getHWAddress();
DuidPtr duid = host->getDuid();
- // There should be at least one resource reserved: hostname, IPv4
- // address, siaddr, sname, file or IPv6 address or prefix.
- /// @todo: this check should be done in add(), not in add4()
- if (host->getHostname().empty() &&
- (host->getIPv4Reservation().isV4Zero()) &&
- !host->hasIPv6Reservation() &&
- host->getNextServer().isV4Zero() &&
- host->getServerHostname().empty() &&
- host->getBootFileName().empty() &&
- host->getCfgOption4()->empty() &&
- host->getCfgOption6()->empty() &&
- host->getClientClasses4().empty() &&
- host->getClientClasses6().empty()) {
- std::ostringstream s;
- if (hwaddr) {
- s << "for DUID: " << hwaddr->toText();
- } else if (duid) {
- s << "for HW address: " << duid->toText();
- }
- isc_throw(BadValue, "specified reservation " << s.str()
- << " must include at least one resource, i.e. "
- "hostname, IPv4 address, IPv6 address/prefix, "
- "options");
- }
-
// Check for duplicates for the specified IPv4 subnet.
if (host->getIPv4SubnetID() != SUBNET_ID_UNUSED) {
if (hwaddr && !hwaddr->hwaddr_.empty() &&