From: Marcin Siodelski Date: Tue, 5 Dec 2017 10:37:04 +0000 (+0100) Subject: [5442] Add log messages when packet is dropped. X-Git-Tag: trac5443_base~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=075aedcef0590342b5a586dab39e27be5cc18f4b;p=thirdparty%2Fkea.git [5442] Add log messages when packet is dropped. --- diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index 15b9e82723..05426d29e7 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -404,6 +404,12 @@ will not send a response but will instead ignore the packet. The first argument contains the client and transaction identification information. The second argument includes the details of the error. +% DHCP4_PACKET_DROP_0008 %1: DHCP service is globally disabled +This debug message is issued when a packet is dropped because the DHCP service +has been temporarily disabled. This affects all received DHCP packets. The +service may be enabled by the "dhcp-enable" control command or automatically +after a specified amount of time since receiving "dhcp-disable" command. + % DHCP4_PACKET_NAK_0001 %1: failed to select a subnet for incoming packet, src %2, type %3 This error message is output when a packet was received from a subnet for which the DHCPv4 server has not been configured. The most probable diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 6dda15b7e2..ca2e58abdc 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -806,6 +806,9 @@ Dhcpv4Srv::run_one() { // If the DHCP service has been globally disabled, drop the packet. if (network_state_.isServiceEnabled()) { + LOG_DEBUG(bad_packet4_logger, DBG_DHCP4_BASIC, + DHCP4_PACKET_DROP_0008) + .arg(query->getLabel()); processPacket(query, rsp); } diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index 4fde8c77ed..d895a45493 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -409,6 +409,12 @@ server is about to open sockets on the specified port. A warning message issued when IfaceMgr fails to open and bind a socket. The reason for the failure is appended as an argument of the log message. +% DHCP6_PACKET_DROP_DHCP_DISABLED %1: DHCP service is globally disabled +This debug message is issued when a packet is dropped because the DHCP service +has been temporarily disabled. This affects all received DHCP packets. The +service may be enabled by the "dhcp-enable" control command or automatically +after a specified amount of time since receiving "dhcp-disable" command. + % DHCP6_PACKET_DROP_PARSE_FAIL failed to parse packet from %1 to %2, received over interface %3, reason: %4 The DHCPv4 server has received a packet that it is unable to interpret. The reason why the packet is invalid is included in the message. diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index df488d29c3..c39073519e 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -470,6 +470,9 @@ void Dhcpv6Srv::run_one() { // If the DHCP service has been globally disabled, drop the packet. if (network_state_.isServiceEnabled()) { + LOG_DEBUG(bad_packet6_logger, DBG_DHCP6_DETAIL_DATA, + DHCP6_PACKET_DROP_DHCP_DISABLED) + .arg(query->getLabel()); processPacket(query, rsp); }