Commit 26c68696 authored by Marcin Siodelski's avatar Marcin Siodelski

[3512] Minor tweaks in the logging of warnings when socket fails to open.

parent c3b0803c
......@@ -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"
......
......@@ -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);
......
......@@ -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_;
};
......
......@@ -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.
......
......@@ -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));
}
......
......@@ -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_;
......
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