From: Piotrek Zadroga Date: Fri, 2 Jun 2023 16:12:37 +0000 (+0200) Subject: [#2865] Add hwaddr to pkt4 prints X-Git-Tag: Kea-2.4.0~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d762695a76ede8d4abb1cdad555b4f39e0aff43;p=thirdparty%2Fkea.git [#2865] Add hwaddr to pkt4 prints --- diff --git a/src/bin/dhcp4/dhcp4_messages.cc b/src/bin/dhcp4/dhcp4_messages.cc index df8984622e..e0c1e8c8b3 100644 --- a/src/bin/dhcp4/dhcp4_messages.cc +++ b/src/bin/dhcp4/dhcp4_messages.cc @@ -284,11 +284,11 @@ const char* values[] = { "DHCP4_PACKET_DROP_0007", "%1: failed to process packet: %2", "DHCP4_PACKET_DROP_0008", "%1: DHCP service is globally disabled", "DHCP4_PACKET_DROP_0009", "%1: Option 53 missing (no DHCP message type), is this a BOOTP packet?", - "DHCP4_PACKET_DROP_0010", "dropped as member of the special class 'DROP': %1", + "DHCP4_PACKET_DROP_0010", "dropped as member of the special class 'DROP': %1 hwaddr=%2", "DHCP4_PACKET_DROP_0011", "dropped as sent by the same client than a packet being processed by another thread: dropped %1 by thread %2 as duplicate of %3 processed by %4", "DHCP4_PACKET_DROP_0012", "dropped as sent by the same client than a packet being processed by another thread: dropped %1 by thread %2 as duplicate of %3 processed by %4", - "DHCP4_PACKET_DROP_0013", "dropped as member of the special class 'DROP' after host reservation lookup: %1", - "DHCP4_PACKET_DROP_0014", "dropped as member of the special class 'DROP' after early global host reservations lookup: %1", + "DHCP4_PACKET_DROP_0013", "dropped as member of the special class 'DROP' after host reservation lookup: %1 hwaddr=%2", + "DHCP4_PACKET_DROP_0014", "dropped as member of the special class 'DROP' after early global host reservations lookup: %1 hwaddr=%2", "DHCP4_PACKET_NAK_0001", "%1: failed to select a subnet for incoming packet, src %2, type %3", "DHCP4_PACKET_NAK_0002", "%1: invalid address %2 requested by INIT-REBOOT", "DHCP4_PACKET_NAK_0003", "%1: failed to advertise a lease, client sent ciaddr %2, requested-ip-address %3", diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index 36515bfd84..7bd7bc8e2d 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -637,7 +637,7 @@ This debug message is issued when a packet is dropped because it did contain option 53 and thus has no DHCP message type. The most likely explanation is that it was BOOTP packet. -% DHCP4_PACKET_DROP_0010 dropped as member of the special class 'DROP': %1 +% DHCP4_PACKET_DROP_0010 dropped as member of the special class 'DROP': %1 hwaddr=%2 This debug message is emitted when an incoming packet was classified into the special class 'DROP' and dropped. The packet details are displayed. @@ -655,12 +655,12 @@ processing is finished. Packet details and thread identifiers are included for both packets in this warning message. -% DHCP4_PACKET_DROP_0013 dropped as member of the special class 'DROP' after host reservation lookup: %1 +% DHCP4_PACKET_DROP_0013 dropped as member of the special class 'DROP' after host reservation lookup: %1 hwaddr=%2 This debug message is emitted when an incoming packet was classified after host reservation lookup into the special class 'DROP' and dropped. The packet details are displayed. -% DHCP4_PACKET_DROP_0014 dropped as member of the special class 'DROP' after early global host reservations lookup: %1 +% DHCP4_PACKET_DROP_0014 dropped as member of the special class 'DROP' after early global host reservations lookup: %1 hwaddr=%2 This debug message is emitted when an incoming packet was classified after early global host reservations lookup into the special class 'DROP' and dropped. The packet details are displayed. diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc index 0b30e75c96..cd64d9a541 100644 --- a/src/bin/dhcp4/dhcp4_srv.cc +++ b/src/bin/dhcp4/dhcp4_srv.cc @@ -262,7 +262,7 @@ Dhcpv4Exchange::Dhcpv4Exchange(const AllocEnginePtr& alloc_engine, // Check the DROP special class. if (query_->inClass("DROP")) { LOG_DEBUG(packet4_logger, DBGLVL_PKT_HANDLING, DHCP4_PACKET_DROP_0013) - .arg(query_->toText()); + .arg(query_->toText()).arg(query_->getHWAddr()->toText());; isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop", static_cast(1)); drop = true; @@ -983,7 +983,7 @@ Dhcpv4Srv::earlyGHRLookup(const Pkt4Ptr& query, if (query->inClass("DROP")) { LOG_DEBUG(packet4_logger, DBGLVL_PKT_HANDLING, DHCP4_PACKET_DROP_0014) - .arg(query->toText()); + .arg(query->toText()).arg(query->getHWAddr()->toText());; isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop", static_cast(1)); return (false); @@ -1299,7 +1299,7 @@ Dhcpv4Srv::processPacket(Pkt4Ptr& query, Pkt4Ptr& rsp, bool allow_packet_park) { // Check the DROP special class. if (query->inClass("DROP")) { LOG_DEBUG(packet4_logger, DBGLVL_PKT_HANDLING, DHCP4_PACKET_DROP_0010) - .arg(query->toText()); + .arg(query->toText()).arg(query->getHWAddr()->toText()); isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop", static_cast(1)); return;