summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/srv_config.cc
diff options
context:
space:
mode:
authorRazvan Becheriu <razvan@isc.org>2022-01-21 19:15:53 +0100
committerRazvan Becheriu <razvan@isc.org>2022-01-21 19:59:09 +0100
commit70cf8d8f46b3bb4b3375fb6b5198e4d2295144ff (patch)
treeec6556eb5e1a49a46013e94030ea6dd04a66aa9c /src/lib/dhcpsrv/srv_config.cc
parent[#2279] remove duplicate "server-tag" (diff)
downloadkea-70cf8d8f46b3bb4b3375fb6b5198e4d2295144ff.tar.xz
kea-70cf8d8f46b3bb4b3375fb6b5198e4d2295144ff.zip
[#2279] "loggers" should be inside the Dhcp[4|6] map
Diffstat (limited to '')
-rw-r--r--src/lib/dhcpsrv/srv_config.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/lib/dhcpsrv/srv_config.cc b/src/lib/dhcpsrv/srv_config.cc
index caf0acd60d..0e233581c8 100644
--- a/src/lib/dhcpsrv/srv_config.cc
+++ b/src/lib/dhcpsrv/srv_config.cc
@@ -597,11 +597,8 @@ SrvConfig::sanityChecksLifetime(const SrvConfig& target_config,
ElementPtr
SrvConfig::toElement() const {
- // Toplevel map
- ElementPtr result = ConfigBase::toElement();
-
- // The "server-tag" is added by configured globals
- result->remove("server-tag");
+ // Top level map
+ ElementPtr result = Element::createMap();
// Get family for the configuration manager
uint16_t family = CfgMgr::instance().getFamily();
@@ -609,6 +606,19 @@ SrvConfig::toElement() const {
// DhcpX global map initialized from configured globals
ElementPtr dhcp = configured_globals_->toElement();
+ auto loggers_info = getLoggingInfo();
+ // Was in the Logging global map.
+ if (!loggers_info.empty()) {
+ // Set loggers list
+ ElementPtr loggers = Element::createList();
+ for (LoggingInfoStorage::const_iterator logger =
+ loggers_info.cbegin();
+ logger != loggers_info.cend(); ++logger) {
+ loggers->add(logger->toElement());
+ }
+ dhcp->set("loggers", loggers);
+ }
+
// Set user-context
contextToElement(dhcp);