From: Marcin Siodelski Date: Thu, 11 Jul 2013 15:02:01 +0000 (+0200) Subject: [1555] Open only selected sockets when Kea starts up. X-Git-Tag: bind10-1.2.0beta1-release~335^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98c85cb61b5bcbf948e1ea0923adcfcdca753cbb;p=thirdparty%2Fkea.git [1555] Open only selected sockets when Kea starts up. --- diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index 4ff7f37076..ebe2455cb2 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -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 diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index af473d1dbf..0bd9c51320 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -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