summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2022-01-21 18:44:16 +0100
committerRazvan Becheriu <razvan@isc.org>2022-01-21 19:59:09 +0100
commit741c87221888432cda0c622fc02260ad3b5ded9d (patch)
tree69b98fe66af6794fc50ce59aaaeafb87d0b80a67
parent[#2279] added unittests (diff)
downloadkea-741c87221888432cda0c622fc02260ad3b5ded9d.tar.xz
kea-741c87221888432cda0c622fc02260ad3b5ded9d.zip
[#2279] loggers is not a scalar
-rw-r--r--src/bin/dhcp4/json_config_parser.cc8
-rw-r--r--src/bin/dhcp6/json_config_parser.cc8
-rw-r--r--src/lib/dhcpsrv/cfg_globals.cc1
-rw-r--r--src/lib/dhcpsrv/cfg_globals.h1
-rw-r--r--src/lib/dhcpsrv/srv_config.cc2
5 files changed, 7 insertions, 13 deletions
diff --git a/src/bin/dhcp4/json_config_parser.cc b/src/bin/dhcp4/json_config_parser.cc
index f3c280e95e..848019390e 100644
--- a/src/bin/dhcp4/json_config_parser.cc
+++ b/src/bin/dhcp4/json_config_parser.cc
@@ -617,6 +617,7 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
(config_pair.first == "shared-networks") ||
(config_pair.first == "reservations") ||
(config_pair.first == "config-control") ||
+ (config_pair.first == "loggers") ||
(config_pair.first == "compatibility")) {
continue;
}
@@ -654,7 +655,6 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
(config_pair.first == "t2-percent") ||
(config_pair.first == "cache-threshold") ||
(config_pair.first == "cache-max-age") ||
- (config_pair.first == "loggers") ||
(config_pair.first == "hostname-char-set") ||
(config_pair.first == "hostname-char-replacement") ||
(config_pair.first == "ddns-send-updates") ||
@@ -755,8 +755,7 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
const HooksConfig& libraries =
CfgMgr::instance().getStagingCfg()->getHooksConfig();
libraries.loadLibraries();
- }
- catch (const isc::Exception& ex) {
+ } catch (const isc::Exception& ex) {
LOG_ERROR(dhcp4_logger, DHCP4_PARSER_COMMIT_FAIL).arg(ex.what());
answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
@@ -780,8 +779,7 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
// If there are config backends, fetch and merge into staging config
server.getCBControl()->databaseConfigFetch(srv_cfg,
CBControlDHCPv4::FetchMode::FETCH_ALL);
- }
- catch (const isc::Exception& ex) {
+ } catch (const isc::Exception& ex) {
std::ostringstream err;
err << "during update from config backend database: " << ex.what();
LOG_ERROR(dhcp4_logger, DHCP4_PARSER_COMMIT_FAIL).arg(err.str());
diff --git a/src/bin/dhcp6/json_config_parser.cc b/src/bin/dhcp6/json_config_parser.cc
index 8e70d572f1..35d271bd6a 100644
--- a/src/bin/dhcp6/json_config_parser.cc
+++ b/src/bin/dhcp6/json_config_parser.cc
@@ -755,6 +755,7 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
(config_pair.first == "reservations") ||
(config_pair.first == "config-control") ||
(config_pair.first == "relay-supplied-options") ||
+ (config_pair.first == "loggers") ||
(config_pair.first == "compatibility")) {
continue;
}
@@ -789,7 +790,6 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
(config_pair.first == "t2-percent") ||
(config_pair.first == "cache-threshold") ||
(config_pair.first == "cache-max-age") ||
- (config_pair.first == "loggers") ||
(config_pair.first == "hostname-char-set") ||
(config_pair.first == "hostname-char-replacement") ||
(config_pair.first == "ddns-send-updates") ||
@@ -890,8 +890,7 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
const HooksConfig& libraries =
CfgMgr::instance().getStagingCfg()->getHooksConfig();
libraries.loadLibraries();
- }
- catch (const isc::Exception& ex) {
+ } catch (const isc::Exception& ex) {
LOG_ERROR(dhcp6_logger, DHCP6_PARSER_COMMIT_FAIL).arg(ex.what());
answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, ex.what());
@@ -915,8 +914,7 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set,
// If there are config backends, fetch and merge into staging config
server.getCBControl()->databaseConfigFetch(srv_config,
CBControlDHCPv6::FetchMode::FETCH_ALL);
- }
- catch (const isc::Exception& ex) {
+ } catch (const isc::Exception& ex) {
std::ostringstream err;
err << "during update from config backend database: " << ex.what();
LOG_ERROR(dhcp6_logger, DHCP6_PARSER_COMMIT_FAIL).arg(err.str());
diff --git a/src/lib/dhcpsrv/cfg_globals.cc b/src/lib/dhcpsrv/cfg_globals.cc
index 27c93538e4..8d6d5a3356 100644
--- a/src/lib/dhcpsrv/cfg_globals.cc
+++ b/src/lib/dhcpsrv/cfg_globals.cc
@@ -48,7 +48,6 @@ CfgGlobals::nameToIndex = {
{ "ddns-update-on-renew", DDNS_UPDATE_ON_RENEW },
{ "ddns-use-conflict-resolution", DDNS_USE_CONFLICT_RESOLUTION },
{ "parked-packet-limit", PARKED_PACKET_LIMIT },
- { "loggers", LOGGERS },
// DHCPv4 specific parameters.
{ "echo-client-id", ECHO_CLIENT_ID },
diff --git a/src/lib/dhcpsrv/cfg_globals.h b/src/lib/dhcpsrv/cfg_globals.h
index ad3d0b9559..1f7dfae4cc 100644
--- a/src/lib/dhcpsrv/cfg_globals.h
+++ b/src/lib/dhcpsrv/cfg_globals.h
@@ -71,7 +71,6 @@ public:
DDNS_UPDATE_ON_RENEW,
DDNS_USE_CONFLICT_RESOLUTION,
PARKED_PACKET_LIMIT,
- LOGGERS,
// DHCPv4 specific parameters.
ECHO_CLIENT_ID,
diff --git a/src/lib/dhcpsrv/srv_config.cc b/src/lib/dhcpsrv/srv_config.cc
index 47a33b01d5..5281e3ebb6 100644
--- a/src/lib/dhcpsrv/srv_config.cc
+++ b/src/lib/dhcpsrv/srv_config.cc
@@ -598,7 +598,7 @@ SrvConfig::sanityChecksLifetime(const SrvConfig& target_config,
ElementPtr
SrvConfig::toElement() const {
// Toplevel map
- ElementPtr result = Element::createMap();
+ ElementPtr result = ConfigBase::toElement();
// Get family for the configuration manager
uint16_t family = CfgMgr::instance().getFamily();