Commit 4084c5f2 authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[1555] Throw exception if the interface instance is NULL.

parent 6b65ea8a
......@@ -835,6 +835,11 @@ Dhcpv4Srv::openActiveSockets(const uint16_t port,
for (IfaceMgr::IfaceCollection::const_iterator iface = ifaces.begin();
iface != ifaces.end(); ++iface) {
Iface* iface_ptr = IfaceMgr::instance().getIface(iface->getName());
if (iface_ptr == NULL) {
isc_throw(isc::Unexpected, "Interface Manager returned NULL"
<< " instance of the interface when DHCPv4 server was"
<< " trying to reopen sockets after reconfiguration");
}
if (CfgMgr::instance().isActiveIface(iface->getName())) {
iface_ptr->inactive4_ = false;
LOG_INFO(dhcp4_logger, DHCP4_ACTIVATE_INTERFACE)
......
......@@ -1116,6 +1116,11 @@ Dhcpv6Srv::openActiveSockets(const uint16_t port) {
for (IfaceMgr::IfaceCollection::const_iterator iface = ifaces.begin();
iface != ifaces.end(); ++iface) {
Iface* iface_ptr = IfaceMgr::instance().getIface(iface->getName());
if (iface_ptr == NULL) {
isc_throw(isc::Unexpected, "Interface Manager returned NULL"
<< " instance of the interface when DHCPv6 server was"
<< " trying to reopen sockets after reconfiguration");
}
if (CfgMgr::instance().isActiveIface(iface->getName())) {
iface_ptr->inactive4_ = false;
LOG_INFO(dhcp6_logger, DHCP6_ACTIVATE_INTERFACE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment