From: Francis Dupont Date: Thu, 23 Jul 2020 19:21:02 +0000 (+0200) Subject: [#1330] Moved closeSockets X-Git-Tag: Kea-1.7.10~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fdd4d7ef9a625c9bc6891693a066f134e9a6dbf;p=thirdparty%2Fkea.git [#1330] Moved closeSockets --- diff --git a/src/bin/dhcp4/json_config_parser.cc b/src/bin/dhcp4/json_config_parser.cc index 45dec95a21..c950ee07eb 100644 --- a/src/bin/dhcp4/json_config_parser.cc +++ b/src/bin/dhcp4/json_config_parser.cc @@ -315,8 +315,9 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set, // so newly recreated configuration starts with first subnet-id equal 1. Subnet::resetSubnetID(); - // Remove any existing timers. + // Close DHCP sockets and remove any existing timers. if (!check_only) { + IfaceMgr::instance().closeSockets(); TimerMgr::instance()->unregisterTimers(); server.discardPackets(); server.getCBControl()->reset(); diff --git a/src/bin/dhcp6/json_config_parser.cc b/src/bin/dhcp6/json_config_parser.cc index 9df0195bb2..ee2203c8d1 100644 --- a/src/bin/dhcp6/json_config_parser.cc +++ b/src/bin/dhcp6/json_config_parser.cc @@ -417,8 +417,9 @@ configureDhcp6Server(Dhcpv6Srv& server, isc::data::ConstElementPtr config_set, // so newly recreated configuration starts with first subnet-id equal 1. Subnet::resetSubnetID(); - // Remove any existing timers. + // Close DHCP sockets and remove any existing timers. if (!check_only) { + IfaceMgr::instance().closeSockets(); TimerMgr::instance()->unregisterTimers(); server.discardPackets(); server.getCBControl()->reset(); diff --git a/src/lib/dhcpsrv/parsers/ifaces_config_parser.cc b/src/lib/dhcpsrv/parsers/ifaces_config_parser.cc index 3cccfaba73..d1db5dcaab 100644 --- a/src/lib/dhcpsrv/parsers/ifaces_config_parser.cc +++ b/src/lib/dhcpsrv/parsers/ifaces_config_parser.cc @@ -41,11 +41,6 @@ void IfacesConfigParser::parse(const CfgIfacePtr& cfg, const isc::data::ConstElementPtr& ifaces_config) { - // Close sockets if not in test mode. - if (!test_mode_) { - IfaceMgr::instance().closeSockets(); - } - // Check for re-detect before calling parseInterfacesList() bool re_detect = getBoolean(ifaces_config, "re-detect"); cfg->setReDetect(re_detect);