]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1555] Open only selected sockets when Kea starts up.
authorMarcin Siodelski <marcin@isc.org>
Thu, 11 Jul 2013 15:02:01 +0000 (17:02 +0200)
committerMarcin Siodelski <marcin@isc.org>
Thu, 11 Jul 2013 15:02:01 +0000 (17:02 +0200)
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc

index 4ff7f370769582ed40ef73753204796a0e6a203e..ebe2455cb2212f0fa85af63f2acaa651bd14479f 100644 (file)
@@ -192,8 +192,13 @@ void ControlledDhcpv4Srv::establishSession() {
 
     try {
         configureDhcp4Server(*this, config_session_->getFullConfig());
+        // Configuration may disable or enable interfaces so we have to
+        // reopen sockets according to new configuration.
+        openActiveSockets(getPort(), useBroadcast());
+
     } catch (const DhcpConfigError& ex) {
         LOG_ERROR(dhcp4_logger, DHCP4_CONFIG_LOAD_FAIL).arg(ex.what());
+
     }
 
     /// Integrate the asynchronous I/O model of BIND 10 configuration
index af473d1dbf9a527afcd308209efec8ca9e8c5fa9..0bd9c51320882f0e813dd85f40a2f5b524e75fce 100644 (file)
@@ -193,8 +193,13 @@ void ControlledDhcpv6Srv::establishSession() {
     try {
         // Pull the full configuration out from the session.
         configureDhcp6Server(*this, config_session_->getFullConfig());
+        // Configuration may disable or enable interfaces so we have to
+        // reopen sockets according to new configuration.
+        openActiveSockets(getPort());
+
     } catch (const DhcpConfigError& ex) {
         LOG_ERROR(dhcp6_logger, DHCP6_CONFIG_LOAD_FAIL).arg(ex.what());
+
     }
 
     /// Integrate the asynchronous I/O model of BIND 10 configuration