]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2865] Reformat prints
authorPiotrek Zadroga <piotrek@isc.org>
Mon, 5 Jun 2023 14:27:37 +0000 (16:27 +0200)
committerPiotrek Zadroga <piotrek@isc.org>
Wed, 7 Jun 2023 08:40:21 +0000 (08:40 +0000)
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_srv.cc

index e0c1e8c8b3261769eb27216bffe26cee72985bbb..4b6d285b0a8b84b8b66f7757f85d4d33c4c25286 100644 (file)
@@ -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 hwaddr=%2",
+    "DHCP4_PACKET_DROP_0010", "dropped as member of the special class 'DROP': hwaddr=%1, %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 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_DROP_0013", "dropped as member of the special class 'DROP' after host reservation lookup: hwaddr=%1, %2",
+    "DHCP4_PACKET_DROP_0014", "dropped as member of the special class 'DROP' after early global host reservations lookup: hwaddr=%1, %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",
index 7bd7bc8e2dddab623815e885050c8afa1baa1552..88a44440656a84799e92d46331e1bfbe46bbeccb 100644 (file)
@@ -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 hwaddr=%2
+% DHCP4_PACKET_DROP_0010 dropped as member of the special class 'DROP': hwaddr=%1, %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 hwaddr=%2
+% DHCP4_PACKET_DROP_0013 dropped as member of the special class 'DROP' after host reservation lookup: hwaddr=%1, %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 hwaddr=%2
+% DHCP4_PACKET_DROP_0014 dropped as member of the special class 'DROP' after early global host reservations lookup: hwaddr=%1, %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.
index 911a85a444c4ee15cca0bff081e72d497e85dffb..ff3a93736870cff35a97134cbfc150bec17ac9c4 100644 (file)
@@ -262,7 +262,8 @@ 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_->getHWAddr()->toText(false));;
+            .arg(query_->getHWAddr() ? query_->getHWAddr()->toText(false) : "(undefined)")
+            .arg(query_->toText());
         isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop",
                                                   static_cast<int64_t>(1));
         drop = true;
@@ -983,7 +984,8 @@ 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->getHWAddr()->toText(false));;
+                    .arg(query->getHWAddr() ? query->getHWAddr()->toText(false) : "(undefined)")
+                    .arg(query->toText());
                 isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop",
                                                           static_cast<int64_t>(1));
                 return (false);
@@ -1299,7 +1301,8 @@ 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->getHWAddr()->toText(false));
+            .arg(query->getHWAddr() ? query->getHWAddr()->toText(false) : "(undefined)")
+            .arg(query->toText());
         isc::stats::StatsMgr::instance().addValue("pkt4-receive-drop",
                                                   static_cast<int64_t>(1));
         return;