From: Francis Dupont Date: Tue, 28 Apr 2020 12:40:47 +0000 (+0200) Subject: [#1189] Fixed config-backend-pull commands X-Git-Tag: Kea-1.7.9~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50bc37c69564ef20447d8b9be840c3dc6d5d8a25;p=thirdparty%2Fkea.git [#1189] Fixed config-backend-pull commands --- diff --git a/ChangeLog b/ChangeLog index b9a1a3f1c5..d0527dafdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1757. [bug] fdupont + config-backend-pull commands were fixed to be applied to the + current configuration + (Gitlab #1189) + 1756. [bug] fdupont Made the parking lot API generic thread safe. (Gitlab #1255) diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index 569bfba441..e18487723e 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -603,8 +603,10 @@ ControlledDhcpv4Srv::commandConfigBackendPullHandler(const std::string&, } // Code from cbFetchUpdates. + // The configuration to use is the current one because this is called + // after the configuration manager commit. try { - auto srv_cfg = CfgMgr::instance().getStagingCfg(); + auto srv_cfg = CfgMgr::instance().getCurrentCfg(); auto mode = CBControlDHCPv4::FetchMode::FETCH_UPDATE; server_->getCBControl()->databaseConfigFetch(srv_cfg, mode); } catch (const std::exception& ex) { diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index 358c235905..eeb061797f 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -606,8 +606,10 @@ ControlledDhcpv6Srv::commandConfigBackendPullHandler(const std::string&, } // Code from cbFetchUpdates. + // The configuration to use is the current one because this is called + // after the configuration manager commit. try { - auto srv_cfg = CfgMgr::instance().getStagingCfg(); + auto srv_cfg = CfgMgr::instance().getCurrentCfg(); auto mode = CBControlDHCPv6::FetchMode::FETCH_UPDATE; server_->getCBControl()->databaseConfigFetch(srv_cfg, mode); } catch (const std::exception& ex) {