2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[#1915] Converted some logs to PKT_HANDLING level

This commit is contained in:
Tomek Mrugalski
2021-06-25 17:08:36 +02:00
committed by Razvan Becheriu
parent cc6adb9bb2
commit 320f2d2b97
4 changed files with 15 additions and 13 deletions

View File

@@ -1101,7 +1101,7 @@ Dhcpv4Srv::processPacket(Pkt4Ptr& query, Pkt4Ptr& rsp, bool allow_packet_park) {
// The response (rsp) is null so the caller (run_one) will
// immediately return too.
if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
LOG_DEBUG(hooks_logger, DBG_DHCP4_DETAIL,
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING,
DHCP4_HOOK_BUFFER_RCVD_DROP)
.arg(query->getRemoteAddr().toText())
.arg(query->getLocalAddr().toText())
@@ -1114,7 +1114,7 @@ Dhcpv4Srv::processPacket(Pkt4Ptr& query, Pkt4Ptr& rsp, bool allow_packet_park) {
// stage means that callouts did the parsing already, so server
// should skip parsing.
if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_SKIP) {
LOG_DEBUG(hooks_logger, DBG_DHCP4_DETAIL,
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING,
DHCP4_HOOK_BUFFER_RCVD_SKIP)
.arg(query->getRemoteAddr().toText())
.arg(query->getLocalAddr().toText())
@@ -1401,7 +1401,7 @@ Dhcpv4Srv::processDhcp4Query(Pkt4Ptr& query, Pkt4Ptr& rsp,
// Drop the park job on the packet, it isn't needed.
HooksManager::drop("leases4_committed", query);
if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
LOG_DEBUG(hooks_logger, DBG_DHCP4_HOOKS, DHCP4_HOOK_LEASES4_COMMITTED_DROP)
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING, DHCP4_HOOK_LEASES4_COMMITTED_DROP)
.arg(query->getLabel());
rsp.reset();
}
@@ -1474,7 +1474,7 @@ Dhcpv4Srv::processPacketPktSend(hooks::CalloutHandlePtr& callout_handle,
/// Callouts decided to drop the packet.
if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
LOG_DEBUG(hooks_logger, DBG_DHCP4_HOOKS, DHCP4_HOOK_PACKET_SEND_DROP)
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING, DHCP4_HOOK_PACKET_SEND_DROP)
.arg(rsp->getLabel());
rsp.reset();
return;
@@ -3208,7 +3208,7 @@ Dhcpv4Srv::processRelease(Pkt4Ptr& release, AllocEngine::ClientContext4Ptr& cont
if ((callout_handle->getStatus() == CalloutHandle::NEXT_STEP_SKIP) ||
(callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP)) {
skip = true;
LOG_DEBUG(hooks_logger, DBG_DHCP4_HOOKS,
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING,
DHCP4_HOOK_LEASE4_RELEASE_SKIP)
.arg(release->getLabel());
}
@@ -3358,7 +3358,7 @@ Dhcpv4Srv::declineLease(const Lease4Ptr& lease, const Pkt4Ptr& decline,
// If any of them did, we will drop the packet.
if ((callout_handle->getStatus() == CalloutHandle::NEXT_STEP_SKIP) ||
(callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP)) {
LOG_DEBUG(hooks_logger, DBG_DHCP4_HOOKS, DHCP4_HOOK_DECLINE_SKIP)
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING, DHCP4_HOOK_DECLINE_SKIP)
.arg(decline->getLabel()).arg(lease->addr_.toText());
return;
}

View File

@@ -14,6 +14,7 @@
using namespace std;
using namespace isc::util;
using namespace isc::log;
namespace isc {
namespace dhcp {
@@ -126,7 +127,7 @@ ClientHandler::tryLock(Pkt6Ptr query, ContinuationPtr cont) {
if (next_query) {
// Logging a warning as it is supposed to be a rare event
// with well behaving clients...
LOG_WARN(bad_packet6_logger, DHCP6_PACKET_DROP_DUPLICATE)
LOG_DEBUG(bad_packet6_logger, DBGLVL_PKT_HANDLING, DHCP6_PACKET_DROP_DUPLICATE)
.arg(next_query->toText())
.arg(this_thread::get_id())
.arg(holder->query_->toText())
@@ -137,7 +138,7 @@ ClientHandler::tryLock(Pkt6Ptr query, ContinuationPtr cont) {
} else {
// Logging a warning as it is supposed to be a rare event
// with well behaving clients...
LOG_WARN(bad_packet6_logger, DHCP6_PACKET_DROP_DUPLICATE)
LOG_DEBUG(bad_packet6_logger, DBGLVL_PKT_HANDLING, DHCP6_PACKET_DROP_DUPLICATE)
.arg(query->toText())
.arg(this_thread::get_id())
.arg(holder->query_->toText())

View File

@@ -9,6 +9,7 @@
#include <dhcp6/dhcp6_messages.h>
#include <log/logger_support.h>
#include <log/log_dbglevels.h>
#include <log/macros.h>
namespace isc {

View File

@@ -685,7 +685,7 @@ Dhcpv6Srv::processPacket(Pkt6Ptr& query, Pkt6Ptr& rsp) {
// The response (rsp) is null so the caller (run_one) will
// immediately return too.
if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
LOG_DEBUG(hooks_logger, DBG_DHCP6_DETAIL, DHCP6_HOOK_BUFFER_RCVD_DROP)
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING, DHCP6_HOOK_BUFFER_RCVD_DROP)
.arg(query->getRemoteAddr().toText())
.arg(query->getLocalAddr().toText())
.arg(query->getIface());
@@ -811,7 +811,7 @@ Dhcpv6Srv::processPacket(Pkt6Ptr& query, Pkt6Ptr& rsp) {
// Check the DROP special class.
if (query->inClass("DROP")) {
LOG_DEBUG(packet6_logger, DBG_DHCP6_BASIC, DHCP6_PACKET_DROP_DROP_CLASS)
LOG_DEBUG(packet6_logger, DBGLVL_PKT_HANDLING, DHCP6_PACKET_DROP_DROP_CLASS)
.arg(query->toText());
StatsMgr::instance().addValue("pkt6-receive-drop",
static_cast<int64_t>(1));
@@ -1067,7 +1067,7 @@ Dhcpv6Srv::processDhcp6Query(Pkt6Ptr& query, Pkt6Ptr& rsp) {
// Drop the park job on the packet, it isn't needed.
HooksManager::drop("leases6_committed", query);
if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
LOG_DEBUG(hooks_logger, DBG_DHCP6_HOOKS, DHCP6_HOOK_LEASES6_COMMITTED_DROP)
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING, DHCP6_HOOK_LEASES6_COMMITTED_DROP)
.arg(query->getLabel());
rsp.reset();
}
@@ -1141,7 +1141,7 @@ Dhcpv6Srv::processPacketPktSend(hooks::CalloutHandlePtr& callout_handle,
/// Callouts decided to drop the packet.
if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
LOG_DEBUG(hooks_logger, DBG_DHCP6_HOOKS, DHCP6_HOOK_PACKET_SEND_DROP)
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING, DHCP6_HOOK_PACKET_SEND_DROP)
.arg(rsp->getLabel());
rsp.reset();
return;
@@ -3616,7 +3616,7 @@ Dhcpv6Srv::declineLease(const Pkt6Ptr& decline, const Lease6Ptr lease,
// Callouts decided to DROP the packet. Let's simply log it and
// return false, so callers will act accordingly.
if (callout_handle->getStatus() == CalloutHandle::NEXT_STEP_DROP) {
LOG_DEBUG(hooks_logger, DBG_DHCP6_DETAIL, DHCP6_HOOK_DECLINE_DROP)
LOG_DEBUG(hooks_logger, DBGLVL_PKT_HANDLING, DHCP6_HOOK_DECLINE_DROP)
.arg(decline->getLabel())
.arg(decline->getIface())
.arg(lease->addr_.toText());