]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3512] Minor tweaks in the logging of warnings when socket fails to open.
authorMarcin Siodelski <marcin@isc.org>
Wed, 20 Aug 2014 15:44:18 +0000 (17:44 +0200)
committerMarcin Siodelski <marcin@isc.org>
Wed, 20 Aug 2014 15:44:18 +0000 (17:44 +0200)
src/lib/dhcp/iface_mgr.cc
src/lib/dhcpsrv/dhcp_parsers.cc
src/lib/dhcpsrv/dhcp_parsers.h
src/lib/dhcpsrv/dhcpsrv_messages.mes
src/lib/dhcpsrv/iface_cfg.cc
src/lib/dhcpsrv/iface_cfg.h

index 381b0f3546f1dfd0bb06880fb4ef909bb2463c0b..ece833361d566e87c14510bdf2207ca65b3c431e 100644 (file)
@@ -469,7 +469,11 @@ IfaceMgr::openSockets4(const uint16_t port, const bool use_bcast,
                                " interface " << iface->getName());
                 continue;
 
-            } else if (!iface->flag_up_ || !iface->flag_running_) {
+            }
+
+            IOAddress out_address("0.0.0.0");
+            if (!iface->flag_up_ || !iface->flag_running_ ||
+                !iface->getAddress4(out_address)) {
                 IFACEMGR_ERROR(SocketConfigError, error_handler,
                                "the interface " << iface->getName()
                                << " is down or has no usable IPv4"
index a7fdf40265c6fe1ffdcf57469e51395f7ee570d0..c34f0199efc40eb2faae67783e18a19d0f0fd782 100644 (file)
@@ -180,8 +180,7 @@ template <> void ValueParser<std::string>::build(ConstElementPtr value) {
 
 InterfaceListConfigParser::
 InterfaceListConfigParser(const std::string& param_name)
-    : activate_all_(false),
-      param_name_(param_name) {
+    : param_name_(param_name) {
     if (param_name_ != "interfaces") {
         isc_throw(BadValue, "Internal error. Interface configuration "
             "parser called for the wrong parameter: " << param_name);
index 0e4082313428edb6330c6c5faf52fd33017be0d0..f723cb1c33b19c09809e2c2ebf1bd9339c16a8ac 100644 (file)
@@ -422,9 +422,6 @@ private:
     typedef std::list<std::string> IfaceListStorage;
     IfaceListStorage interfaces_;
 
-    // Should server listen on all interfaces.
-    bool activate_all_;
-
     // Parsed parameter name
     std::string param_name_;
 };
index ef54f490c97cb3d3d566aeef24df4258ce683cde..cb04ad6001ec7a553a1a7c71afeaed3d123ffff1 100644 (file)
@@ -55,10 +55,10 @@ to clients that are no longer active on the network will become available
 available sooner.
 
 % DHCPSRV_CFGMGR_ADD_IFACE listening on interface %1
-A debug message issued when new interface is being added to the collection of
+An info message issued when new interface is being added to the collection of
 interfaces on which server listens to DHCP messages.
 
-% DHCPSRV_CFGMGR_ADD_UNICAST listening on unicast address %1 on interface %2
+% DHCPSRV_CFGMGR_ADD_UNICAST listening on unicast address %1, on interface %2
 A debug message issued when new configuring DHCP server to listen on unicast
 address on the specific interface.
 
index 7ba4ad93fa171bb2d4221e72385bd127128f5385..68c639559f45e434ac58f4f2e215597460efffb7 100644 (file)
@@ -91,7 +91,7 @@ IfaceCfg::openSockets(const uint16_t port, const bool use_bcast) {
     // for some specific interface. This callback will simply log a
     // warning message.
     IfaceMgrErrorMsgCallback error_callback =
-        boost::bind(&IfaceCfg::socketOpenErrorHandler, this, _1);
+        boost::bind(&IfaceCfg::socketOpenErrorHandler, _1);
     bool sopen;
     if (getFamily() == V4) {
         sopen = IfaceMgr::instance().openSockets4(port, use_bcast,
@@ -165,8 +165,7 @@ IfaceCfg::use(const std::string& iface_name) {
             }
 
             // All ok, add interface.
-            LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE,
-                      DHCPSRV_CFGMGR_ADD_IFACE)
+            LOG_INFO(dhcpsrv_logger, DHCPSRV_CFGMGR_ADD_IFACE)
                 .arg(name);
             iface_set_.insert(name);
 
@@ -249,7 +248,7 @@ IfaceCfg::use(const std::string& iface_name) {
                       "because other unicast address has already been"
                       " specified for this interface");
         }
-        LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE, DHCPSRV_CFGMGR_ADD_UNICAST)
+        LOG_INFO(dhcpsrv_logger, DHCPSRV_CFGMGR_ADD_UNICAST)
             .arg(addr.toText()).arg(name);
         unicast_map_.insert(std::pair<std::string, IOAddress>(name, addr));
     }
index e715450b8055d61e77ac16a3f3a5c76c122bd0a6..6edc32e221a3bde6e648eee0499e7924e383ea15 100644 (file)
@@ -169,7 +169,7 @@ private:
     /// parameter.
     ///
     /// @param errmsg Error message being logged by the function.
-    void socketOpenErrorHandler(const std::string& errmsg);
+    static void socketOpenErrorHandler(const std::string& errmsg);
 
     /// @brief Protocol family.
     Family family_;