]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[1555] Set inactivity flag using pointer to an interface.
authorMarcin Siodelski <marcin@isc.org>
Thu, 11 Jul 2013 14:56:16 +0000 (16:56 +0200)
committerMarcin Siodelski <marcin@isc.org>
Thu, 11 Jul 2013 14:56:16 +0000 (16:56 +0200)
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp6/ctrl_dhcp6_srv.cc

index 78cfb9b8a84829ac56ec11535b8851655ca6b220..4ff7f370769582ed40ef73753204796a0e6a203e 100644 (file)
@@ -255,12 +255,13 @@ ControlledDhcpv4Srv::openActiveSockets(const uint16_t port, const bool use_bcast
     // Get the reference to the collection of interfaces. This reference should be
     // valid as long as the program is run because IfaceMgr is a singleton.
     // Therefore we can safely iterate over instances of all interfaces and modify
-    // their flags. Here we modify flags which indicate wheter socket should be
+    // their flags. Here we modify flags which indicate whether socket should be
     // open for a particular interface or not.
-    IfaceMgr::IfaceCollection ifaces = IfaceMgr::instance().getIfaces();
-    for (IfaceMgr::IfaceCollection::iterator iface = ifaces.begin();
+    const IfaceMgr::IfaceCollection& ifaces = IfaceMgr::instance().getIfaces();
+    for (IfaceMgr::IfaceCollection::const_iterator iface = ifaces.begin();
          iface != ifaces.end(); ++iface) {
-        iface->inactive_ = !CfgMgr::instance().isActiveIface(iface->getName());
+        IfaceMgr::instance().getIface(iface->getName())->inactive_ =
+            !CfgMgr::instance().isActiveIface(iface->getName());
     }
     // Let's reopen active sockets. openSockets4 will check internally whether
     // sockets are marked active or inactive.
index cbd29b90fe076a888afcb02f2d4f73e99799b9d4..af473d1dbf9a527afcd308209efec8ca9e8c5fa9 100644 (file)
@@ -261,7 +261,8 @@ ControlledDhcpv6Srv::openActiveSockets(const uint16_t port) {
     IfaceMgr::IfaceCollection ifaces = IfaceMgr::instance().getIfaces();
     for (IfaceMgr::IfaceCollection::iterator iface = ifaces.begin();
          iface != ifaces.end(); ++iface) {
-        iface->inactive_ = !CfgMgr::instance().isActiveIface(iface->getName());
+        IfaceMgr::instance().getIface(iface->getName())->inactive_ =
+            !CfgMgr::instance().isActiveIface(iface->getName());
     }
     // Let's reopen active sockets. openSockets6 will check internally whether
     // sockets are marked active or inactive.