diff options
author | Marcin Siodelski <marcin@isc.org> | 2014-09-02 20:47:10 +0200 |
---|---|---|
committer | Marcin Siodelski <marcin@isc.org> | 2014-09-02 20:47:10 +0200 |
commit | 615df6d2fdc5b66410d17f3edbd9e9fbf6273c8b (patch) | |
tree | fdff2eba440de9ad2657aaf1b9aa84e8057504b8 /src/bin/dhcp6/ctrl_dhcp6_srv.cc | |
parent | [3534] Fixed generation of the default Kea configuration file. (diff) | |
download | kea-615df6d2fdc5b66410d17f3edbd9e9fbf6273c8b.tar.xz kea-615df6d2fdc5b66410d17f3edbd9e9fbf6273c8b.zip |
[3534] Commit and rollback the staging configuration.
Diffstat (limited to 'src/bin/dhcp6/ctrl_dhcp6_srv.cc')
-rw-r--r-- | src/bin/dhcp6/ctrl_dhcp6_srv.cc | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index 1ba9ba8934..e351e502b9 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -140,19 +140,14 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) { } // Configuration may change active interfaces. Therefore, we have to reopen - // sockets according to new configuration. This operation is not exception - // safe and we really don't want to emit exceptions to the callback caller. - // Instead, catch an exception and create appropriate answer. - try { - CfgMgr::instance().getCurrentCfg()->getCfgIface() - .openSockets(CfgIface::V6, srv->getPort()); - - } catch (const std::exception& ex) { - std::ostringstream err; - err << "failed to open sockets after server reconfiguration: " - << ex.what(); - answer = isc::config::createAnswer(1, err.str()); - } + // sockets according to new configuration. It is possible that this + // operation will fail for some interfaces but the openSockets function + // guards against exceptions and invokes a callback function to + // log warnings. Since we allow that this fails for some interfaces there + // is no need to rollback configuration if socket fails to open on any + // of the interfaces. + CfgMgr::instance().getStagingCfg()-> + getCfgIface().openSockets(CfgIface::V6, srv->getPort()); return (answer); } |