Browse Source

[5333] Added a closeSockets before clearInterfaces

Francis Dupont 8 years ago
parent
commit
b97f9a1f00
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/lib/dhcpsrv/parsers/ifaces_config_parser.cc

+ 3 - 0
src/lib/dhcpsrv/parsers/ifaces_config_parser.cc

@@ -45,6 +45,9 @@ IfacesConfigParser::parse(const CfgIfacePtr& cfg,
     bool re_detect = getBoolean(ifaces_config, "re-detect");
     bool re_detect = getBoolean(ifaces_config, "re-detect");
     cfg->setReDetect(re_detect);
     cfg->setReDetect(re_detect);
     if (re_detect) {
     if (re_detect) {
+        // Interface clear will drop opened socket information
+        // so close them if the caller did not.
+        IfaceMgr::instance().closeSockets();
         IfaceMgr::instance().clearIfaces();
         IfaceMgr::instance().clearIfaces();
         IfaceMgr::instance().detectIfaces();
         IfaceMgr::instance().detectIfaces();
     }
     }