Browse Source

[master] Merge branch 'trac3730'

Marcin Siodelski 10 years ago
parent
commit
3ceb0cd97c
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/lib/dhcpsrv/cfg_iface.cc

+ 3 - 3
src/lib/dhcpsrv/cfg_iface.cc

@@ -58,6 +58,9 @@ CfgIface::multipleAddressesPerInterfaceActive() const {
 void
 CfgIface::openSockets(const uint16_t family, const uint16_t port,
                       const bool use_bcast) const {
+    // Close any open sockets because we're going to modify some properties
+    // of the IfaceMgr. Those modifications require that sockets are closed.
+    closeSockets();
     // If wildcard interface '*' was not specified, set all interfaces to
     // inactive state. We will later enable them selectively using the
     // interface names specified by the user. If wildcard interface was
@@ -127,9 +130,6 @@ CfgIface::openSockets(const uint16_t family, const uint16_t port,
         }
     }
 
-    // Before opening any sockets, close existing ones.
-    closeSockets();
-
     // Set the callback which is called when the socket fails to open
     // for some specific interface. This callback will simply log a
     // warning message.