Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
26c68696
Commit
26c68696
authored
Aug 20, 2014
by
Marcin Siodelski
Browse files
[3512] Minor tweaks in the logging of warnings when socket fails to open.
parent
c3b0803c
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcp/iface_mgr.cc
View file @
26c68696
...
...
@@ -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"
...
...
src/lib/dhcpsrv/dhcp_parsers.cc
View file @
26c68696
...
...
@@ -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
);
...
...
src/lib/dhcpsrv/dhcp_parsers.h
View file @
26c68696
...
...
@@ -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_
;
};
...
...
src/lib/dhcpsrv/dhcpsrv_messages.mes
View file @
26c68696
...
...
@@ -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
A
n 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.
...
...
src/lib/dhcpsrv/iface_cfg.cc
View file @
26c68696
...
...
@@ -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
));
}
...
...
src/lib/dhcpsrv/iface_cfg.h
View file @
26c68696
...
...
@@ -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_
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment