]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2820] add tid in some options logs
authorPiotrek Zadroga <piotrek@isc.org>
Wed, 24 Apr 2024 19:21:21 +0000 (21:21 +0200)
committerPiotrek Zadroga <piotrek@isc.org>
Fri, 26 Apr 2024 12:42:46 +0000 (14:42 +0200)
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp6/dhcp6_messages.cc
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/dhcp6_srv.cc

index 2135c1886cf2c07226369c6ab54c1ed5d225d5b2..187bfc65e13e50c28cd731e352337d4c95ba0361 100644 (file)
@@ -198,7 +198,7 @@ const char* values[] = {
     "DHCP4_ALREADY_RUNNING", "%1 already running? %2",
     "DHCP4_BUFFER_RECEIVED", "received buffer from %1:%2 to %3:%4 over interface %5",
     "DHCP4_BUFFER_RECEIVE_FAIL", "error on attempt to receive packet: %1",
-    "DHCP4_BUFFER_UNPACK", "parsing buffer received from %1 to %2 over interface %3",
+    "DHCP4_BUFFER_UNPACK", "%1: parsing buffer received from %2 to %3 over interface %4",
     "DHCP4_BUFFER_WAIT_SIGNAL", "signal received while waiting for next packet",
     "DHCP4_CB_ON_DEMAND_FETCH_UPDATES_FAIL", "error on demand attempt to fetch configuration updates from the configuration backend(s): %1",
     "DHCP4_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
@@ -320,7 +320,7 @@ const char* values[] = {
     "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",
     "DHCP4_PACKET_NAK_0004", "%1: failed to grant a lease, client sent ciaddr %2, requested-ip-address %3",
-    "DHCP4_PACKET_OPTIONS_SKIPPED", "An error unpacking an option, caused subsequent options to be skipped: %1",
+    "DHCP4_PACKET_OPTIONS_SKIPPED", "%1: An error unpacking an option, caused subsequent options to be skipped: %2",
     "DHCP4_PACKET_OPTION_UNPACK_FAIL", "An error unpacking the option %1: %2",
     "DHCP4_PACKET_PACK", "%1: preparing on-wire format of the packet to be sent",
     "DHCP4_PACKET_PACK_FAIL", "%1: preparing on-wire-format of the packet to be sent failed %2",
index 2ee2c43cc11dc12e62fa8a1e2d073e620ceb3978..2cd097675d24271fd70973f9337649fd4bea060a 100644 (file)
@@ -33,7 +33,7 @@ The DHCPv4 server tried to receive a packet but an error
 occurred during this attempt. The reason for the error is included in
 the message.
 
-% DHCP4_BUFFER_UNPACK parsing buffer received from %1 to %2 over interface %3
+% DHCP4_BUFFER_UNPACK %1: parsing buffer received from %2 to %3 over interface %4
 This debug message is issued when the server starts parsing the received
 buffer holding the DHCPv4 message. The arguments specify the source and
 destination IPv4 addresses as well as the interface over which the buffer has
@@ -763,7 +763,7 @@ identification information. The second argument contains the IPv4 address
 in the ciaddr field. The third argument contains the IPv4 address in the
 requested-ip-address option (if present).
 
-% DHCP4_PACKET_OPTIONS_SKIPPED An error unpacking an option, caused subsequent options to be skipped: %1
+% DHCP4_PACKET_OPTIONS_SKIPPED %1: An error unpacking an option, caused subsequent options to be skipped: %2
 A debug message issued when an option failed to unpack correctly, making it
 impossible to unpack the remaining options in the packet.  The server will
 server will still attempt to service the packet.
index f189aee01f285795ead40551659357460a325e9d..090bfbbbb127b8353e6a546d6437692ff56dea6b 100644 (file)
@@ -1321,6 +1321,7 @@ Dhcpv4Srv::processPacket(Pkt4Ptr query, bool allow_answer_park) {
     if (!skip_unpack) {
         try {
             LOG_DEBUG(options4_logger, DBG_DHCP4_DETAIL, DHCP4_BUFFER_UNPACK)
+                .arg(query->getLabel())
                 .arg(query->getRemoteAddr().toText())
                 .arg(query->getLocalAddr().toText())
                 .arg(query->getIface());
@@ -1330,6 +1331,7 @@ Dhcpv4Srv::processPacket(Pkt4Ptr query, bool allow_answer_park) {
             // anyway.  Log it and let's hope for the best.
             LOG_DEBUG(options4_logger, DBG_DHCP4_DETAIL,
                       DHCP4_PACKET_OPTIONS_SKIPPED)
+                .arg(query->getLabel())
                 .arg(e.what());
         } catch (const std::exception& e) {
             // Failed to parse the packet.
index 878314c884abcd7aece0712a7ca7c1cea7930247..0e3ff87abbc1b895872c17ccbf0e6e54fcd699da 100644 (file)
@@ -189,7 +189,7 @@ const char* values[] = {
     "DHCP6_ADD_STATUS_CODE_FOR_IA", "%1: adding Status Code to IA with iaid=%2: %3",
     "DHCP6_ALREADY_RUNNING", "%1 already running? %2",
     "DHCP6_BUFFER_RECEIVED", "received buffer from %1:%2 to %3:%4 over interface %5",
-    "DHCP6_BUFFER_UNPACK", "parsing buffer received from %1 to %2 over interface %3",
+    "DHCP6_BUFFER_UNPACK", "%1: parsing buffer received from %2 to %3 over interface %4",
     "DHCP6_BUFFER_WAIT_SIGNAL", "signal received while waiting for next packet",
     "DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL", "error on demand attempt to fetch configuration updates from the configuration backend(s): %1",
     "DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL", "error on periodic attempt to fetch configuration updates from the configuration backend(s): %1",
@@ -289,7 +289,7 @@ const char* values[] = {
     "DHCP6_PACKET_DROP_PARSE_FAIL", "%1: failed to parse packet from %2 to %3, received over interface %4, reason: %5, %6",
     "DHCP6_PACKET_DROP_SERVERID_MISMATCH", "%1: dropping packet with server identifier: %2, server is using: %3",
     "DHCP6_PACKET_DROP_UNICAST", "%1: dropping unicast %2 packet as this packet should be sent to multicast",
-    "DHCP6_PACKET_OPTIONS_SKIPPED", "An error unpacking an option, caused subsequent options to be skipped: %1",
+    "DHCP6_PACKET_OPTIONS_SKIPPED", "%1: An error unpacking an option, caused subsequent options to be skipped: %2",
     "DHCP6_PACKET_PROCESS_EXCEPTION", "exception occurred during packet processing",
     "DHCP6_PACKET_PROCESS_FAIL", "%1: processing of %2 message received from %3 failed: %4",
     "DHCP6_PACKET_PROCESS_STD_EXCEPTION", "exception occurred during packet processing: %1",
@@ -298,7 +298,7 @@ const char* values[] = {
     "DHCP6_PACKET_RECEIVE_FAIL", "error on attempt to receive packet: %1",
     "DHCP6_PACKET_SEND", "%1: trying to send packet %2 (type %3) from [%4]:%5 to [%6]:%7 on interface %8",
     "DHCP6_PACKET_SEND_FAIL", "failed to send DHCPv6 packet: %1",
-    "DHCP6_PACK_FAIL", "failed to assemble response correctly",
+    "DHCP6_PACK_FAIL", "1%: failed to assemble response correctly: %2",
     "DHCP6_PARSER_COMMIT_EXCEPTION", "parser failed to commit changes",
     "DHCP6_PARSER_COMMIT_FAIL", "parser failed to commit changes: %1",
     "DHCP6_PARSER_EXCEPTION", "failed to create or run parser for configuration element %1",
index ecd715a0a89362bb13a7ac7861348c26e7c87695..c2ae90127e4c27da6805975407193ce6dc4e58b4 100644 (file)
@@ -48,7 +48,7 @@ over the socket. When the message is logged the contents of the received
 packet hasn't been parsed yet. The only available information is the
 interface and the source and destination addresses/ports.
 
-% DHCP6_BUFFER_UNPACK parsing buffer received from %1 to %2 over interface %3
+% DHCP6_BUFFER_UNPACK %1: parsing buffer received from %2 to %3 over interface %4
 This debug message is issued when the server starts parsing the received
 buffer holding the DHCPv6 message. The arguments specify the source and
 destination addresses as well as the interface over which the buffer has
@@ -647,7 +647,7 @@ because packets of this type must be sent to multicast. The first argument
 specifies the client and transaction identification information, the
 second argument specifies packet type.
 
-% DHCP6_PACKET_OPTIONS_SKIPPED An error unpacking an option, caused subsequent options to be skipped: %1
+% DHCP6_PACKET_OPTIONS_SKIPPED %1: An error unpacking an option, caused subsequent options to be skipped: %2
 A debug message issued when an option failed to unpack correctly, making it
 impossible to unpack the remaining options in the packet.  The server will
 server will still attempt to service the packet.
@@ -698,7 +698,7 @@ This error is output if the IPv6 DHCP server fails to send an assembled
 DHCP message to a client. The reason for the error is included in the
 message.
 
-% DHCP6_PACK_FAIL failed to assemble response correctly
+% DHCP6_PACK_FAIL 1%: failed to assemble response correctly: %2
 This error is output if the server failed to assemble the data to be
 returned to the client into a valid packet.  The reason is most likely
 to be to a programming error: please raise a bug report.
index 1bfe099b1c19ce6906ef47056264e9e97690278a..33921338acd918dc84303396ed7516b996f0306b 100644 (file)
@@ -805,6 +805,7 @@ Dhcpv6Srv::processPacket(Pkt6Ptr query) {
     if (!skip_unpack) {
         try {
             LOG_DEBUG(options6_logger, DBG_DHCP6_DETAIL, DHCP6_BUFFER_UNPACK)
+                .arg(query->getLabel())
                 .arg(query->getRemoteAddr().toText())
                 .arg(query->getLocalAddr().toText())
                 .arg(query->getIface());
@@ -814,6 +815,7 @@ Dhcpv6Srv::processPacket(Pkt6Ptr query) {
             // anyway.  Log it and let's hope for the best.
             LOG_DEBUG(options6_logger, DBG_DHCP6_DETAIL,
                       DHCP6_PACKET_OPTIONS_SKIPPED)
+                .arg(query->getLabel())
                 .arg(e.what());
         } catch (const std::exception &e) {
             // Failed to parse the packet.
@@ -1373,7 +1375,9 @@ Dhcpv6Srv::processPacketPktSend(hooks::CalloutHandlePtr& callout_handle,
         try {
             rsp->pack();
         } catch (const std::exception& e) {
-            LOG_ERROR(options6_logger, DHCP6_PACK_FAIL).arg(e.what());
+            LOG_ERROR(options6_logger, DHCP6_PACK_FAIL)
+                .arg(query->getLabel())
+                .arg(e.what());
             return;
         }