]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2820] addressed review comments
authorPiotrek Zadroga <piotrek@isc.org>
Fri, 26 Apr 2024 10:26:05 +0000 (12:26 +0200)
committerPiotrek Zadroga <piotrek@isc.org>
Fri, 26 Apr 2024 12:43:12 +0000 (14:43 +0200)
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_srv.cc
src/bin/dhcp6/dhcp6_messages.cc
src/bin/dhcp6/dhcp6_messages.h
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/dhcp6_srv.cc

index f52a10e1f5ce16528fa3001c085d86d06380f1d1..3ee62864d8350f54dfdef85ccdc47852ff42f6d5 100644 (file)
@@ -138,7 +138,9 @@ extern const isc::log::MessageID DHCP4_PACKET_OPTION_UNPACK_FAIL = "DHCP4_PACKET
 extern const isc::log::MessageID DHCP4_PACKET_PACK = "DHCP4_PACKET_PACK";
 extern const isc::log::MessageID DHCP4_PACKET_PACK_FAIL = "DHCP4_PACKET_PACK_FAIL";
 extern const isc::log::MessageID DHCP4_PACKET_PROCESS_EXCEPTION = "DHCP4_PACKET_PROCESS_EXCEPTION";
+extern const isc::log::MessageID DHCP4_PACKET_PROCESS_EXCEPTION_MAIN = "DHCP4_PACKET_PROCESS_EXCEPTION_MAIN";
 extern const isc::log::MessageID DHCP4_PACKET_PROCESS_STD_EXCEPTION = "DHCP4_PACKET_PROCESS_STD_EXCEPTION";
+extern const isc::log::MessageID DHCP4_PACKET_PROCESS_STD_EXCEPTION_MAIN = "DHCP4_PACKET_PROCESS_STD_EXCEPTION_MAIN";
 extern const isc::log::MessageID DHCP4_PACKET_QUEUE_FULL = "DHCP4_PACKET_QUEUE_FULL";
 extern const isc::log::MessageID DHCP4_PACKET_RECEIVED = "DHCP4_PACKET_RECEIVED";
 extern const isc::log::MessageID DHCP4_PACKET_SEND = "DHCP4_PACKET_SEND";
@@ -324,7 +326,9 @@ const char* values[] = {
     "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",
     "DHCP4_PACKET_PROCESS_EXCEPTION", "%1: exception occurred during packet processing",
+    "DHCP4_PACKET_PROCESS_EXCEPTION_MAIN", "exception occurred during packet processing",
     "DHCP4_PACKET_PROCESS_STD_EXCEPTION", "%1: exception occurred during packet processing: %2",
+    "DHCP4_PACKET_PROCESS_STD_EXCEPTION_MAIN", "exception occurred during packet processing: %1",
     "DHCP4_PACKET_QUEUE_FULL", "multi-threading packet queue is full",
     "DHCP4_PACKET_RECEIVED", "%1: %2 (type %3) received from %4 to %5 on interface %6",
     "DHCP4_PACKET_SEND", "%1: trying to send packet %2 (type %3) from %4:%5 to %6:%7 on interface %8",
index 3b4f25c51a3f5c48d223282047dd950bed09f8d7..7f9ef8acff6b021cc688967623c420863f881231 100644 (file)
@@ -139,7 +139,9 @@ extern const isc::log::MessageID DHCP4_PACKET_OPTION_UNPACK_FAIL;
 extern const isc::log::MessageID DHCP4_PACKET_PACK;
 extern const isc::log::MessageID DHCP4_PACKET_PACK_FAIL;
 extern const isc::log::MessageID DHCP4_PACKET_PROCESS_EXCEPTION;
+extern const isc::log::MessageID DHCP4_PACKET_PROCESS_EXCEPTION_MAIN;
 extern const isc::log::MessageID DHCP4_PACKET_PROCESS_STD_EXCEPTION;
+extern const isc::log::MessageID DHCP4_PACKET_PROCESS_STD_EXCEPTION_MAIN;
 extern const isc::log::MessageID DHCP4_PACKET_QUEUE_FULL;
 extern const isc::log::MessageID DHCP4_PACKET_RECEIVED;
 extern const isc::log::MessageID DHCP4_PACKET_SEND;
index 3192b2517bda2da63f5e126ed013ae4966390a12..ea0d12922b8c6a66d36ee7ef71f95c06966d0973 100644 (file)
@@ -789,12 +789,26 @@ during packet processing that was not caught by other, more specific
 exception handlers. This packet will be dropped and the server will
 continue operation.
 
+% DHCP4_PACKET_PROCESS_EXCEPTION_MAIN exception occurred during packet processing
+This error message indicates that a non-standard exception was raised
+during packet processing that was not caught by other, more specific
+exception handlers. This packet will be dropped and the server will
+continue operation. This error message may appear in main server processing
+loop.
+
 % DHCP4_PACKET_PROCESS_STD_EXCEPTION %1: exception occurred during packet processing: %2
 This error message indicates that a standard exception was raised
 during packet processing that was not caught by other, more specific
 exception handlers. This packet will be dropped and the server will
 continue operation.
 
+% DHCP4_PACKET_PROCESS_STD_EXCEPTION_MAIN exception occurred during packet processing: %1
+This error message indicates that a standard exception was raised
+during packet processing that was not caught by other, more specific
+exception handlers. This packet will be dropped and the server will
+continue operation. This error message may appear in main server processing
+loop.
+
 % DHCP4_PACKET_QUEUE_FULL multi-threading packet queue is full
 A debug message noting that the multi-threading packet queue is full so
 the oldest packet of the queue was dropped to make room for the received one.
index 9bcfe9f0a2998481953ce607a47c09108d28f409..2136dcb281adc6dd093b4dd5255331ec5acfcc25 100644 (file)
@@ -1136,15 +1136,13 @@ Dhcpv4Srv::run() {
         } catch (const std::exception& e) {
             // General catch-all exception that are not caught by more specific
             // catches. This one is for exceptions derived from std::exception.
-            LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_STD_EXCEPTION)
-                .arg("[no hwaddr info], cid=[no info], tid=[no info]")
+            LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_STD_EXCEPTION_MAIN)
                 .arg(e.what());
         } catch (...) {
             // General catch-all exception that are not caught by more specific
             // catches. This one is for other exceptions, not derived from
             // std::exception.
-            LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_EXCEPTION)
-                .arg("[no hwaddr info], cid=[no info], tid=[no info]");
+            LOG_ERROR(packet4_logger, DHCP4_PACKET_PROCESS_EXCEPTION_MAIN);
         }
     }
 
index 8a04f31fc604be4ea6a948b854fe63fa61fbb4fc..3c01ddb48a4909d3a87b55d88f855b66a23087f7 100644 (file)
@@ -115,8 +115,10 @@ extern const isc::log::MessageID DHCP6_PACKET_DROP_SERVERID_MISMATCH = "DHCP6_PA
 extern const isc::log::MessageID DHCP6_PACKET_DROP_UNICAST = "DHCP6_PACKET_DROP_UNICAST";
 extern const isc::log::MessageID DHCP6_PACKET_OPTIONS_SKIPPED = "DHCP6_PACKET_OPTIONS_SKIPPED";
 extern const isc::log::MessageID DHCP6_PACKET_PROCESS_EXCEPTION = "DHCP6_PACKET_PROCESS_EXCEPTION";
+extern const isc::log::MessageID DHCP6_PACKET_PROCESS_EXCEPTION_MAIN = "DHCP6_PACKET_PROCESS_EXCEPTION_MAIN";
 extern const isc::log::MessageID DHCP6_PACKET_PROCESS_FAIL = "DHCP6_PACKET_PROCESS_FAIL";
 extern const isc::log::MessageID DHCP6_PACKET_PROCESS_STD_EXCEPTION = "DHCP6_PACKET_PROCESS_STD_EXCEPTION";
+extern const isc::log::MessageID DHCP6_PACKET_PROCESS_STD_EXCEPTION_MAIN = "DHCP6_PACKET_PROCESS_STD_EXCEPTION_MAIN";
 extern const isc::log::MessageID DHCP6_PACKET_QUEUE_FULL = "DHCP6_PACKET_QUEUE_FULL";
 extern const isc::log::MessageID DHCP6_PACKET_RECEIVED = "DHCP6_PACKET_RECEIVED";
 extern const isc::log::MessageID DHCP6_PACKET_RECEIVE_FAIL = "DHCP6_PACKET_RECEIVE_FAIL";
@@ -291,8 +293,10 @@ const char* values[] = {
     "DHCP6_PACKET_DROP_UNICAST", "%1: dropping unicast %2 packet as this packet should be sent to multicast",
     "DHCP6_PACKET_OPTIONS_SKIPPED", "%1: An error unpacking an option, caused subsequent options to be skipped: %2",
     "DHCP6_PACKET_PROCESS_EXCEPTION", "%1: exception occurred during packet processing",
+    "DHCP6_PACKET_PROCESS_EXCEPTION_MAIN", "exception occurred during packet processing",
     "DHCP6_PACKET_PROCESS_FAIL", "%1: processing of %2 message received from %3 failed: %4",
     "DHCP6_PACKET_PROCESS_STD_EXCEPTION", "%1: exception occurred during packet processing: %2",
+    "DHCP6_PACKET_PROCESS_STD_EXCEPTION_MAIN", "exception occurred during packet processing: %1",
     "DHCP6_PACKET_QUEUE_FULL", "multi-threading packet queue is full",
     "DHCP6_PACKET_RECEIVED", "%1: %2 (type %3) received from %4 to %5 on interface %6",
     "DHCP6_PACKET_RECEIVE_FAIL", "error on attempt to receive packet: %1",
index 91555d2d11622e7a79362fe2676f98d1a69a77a2..dfcaa1925b68b5dc61d4befbbb4b8d66a73c70bc 100644 (file)
@@ -116,8 +116,10 @@ extern const isc::log::MessageID DHCP6_PACKET_DROP_SERVERID_MISMATCH;
 extern const isc::log::MessageID DHCP6_PACKET_DROP_UNICAST;
 extern const isc::log::MessageID DHCP6_PACKET_OPTIONS_SKIPPED;
 extern const isc::log::MessageID DHCP6_PACKET_PROCESS_EXCEPTION;
+extern const isc::log::MessageID DHCP6_PACKET_PROCESS_EXCEPTION_MAIN;
 extern const isc::log::MessageID DHCP6_PACKET_PROCESS_FAIL;
 extern const isc::log::MessageID DHCP6_PACKET_PROCESS_STD_EXCEPTION;
+extern const isc::log::MessageID DHCP6_PACKET_PROCESS_STD_EXCEPTION_MAIN;
 extern const isc::log::MessageID DHCP6_PACKET_QUEUE_FULL;
 extern const isc::log::MessageID DHCP6_PACKET_RECEIVED;
 extern const isc::log::MessageID DHCP6_PACKET_RECEIVE_FAIL;
index be56caded87861b48ebf4e544ea5f8583b0c7e5d..9e23f25eb4e95b6f80a5984724ec152b46e80b9d 100644 (file)
@@ -658,6 +658,13 @@ during packet processing that was not caught by other, more specific
 exception handlers. This packet will be dropped and the server will
 continue operation.
 
+% DHCP6_PACKET_PROCESS_EXCEPTION_MAIN exception occurred during packet processing
+This error message indicates that a non-standard exception was raised
+during packet processing that was not caught by other, more specific
+exception handlers. This packet will be dropped and the server will
+continue operation. This error message may appear in main server processing
+loop.
+
 % DHCP6_PACKET_PROCESS_FAIL %1: processing of %2 message received from %3 failed: %4
 This is a general catch-all message indicating that the processing of the
 specified packet type from the indicated address failed.  The reason is given in the
@@ -669,6 +676,13 @@ during packet processing that was not caught by other, more specific
 exception handlers. This packet will be dropped and the server will
 continue operation.
 
+% DHCP6_PACKET_PROCESS_STD_EXCEPTION_MAIN exception occurred during packet processing: %1
+This error message indicates that a standard exception was raised
+during packet processing that was not caught by other, more specific
+exception handlers. This packet will be dropped and the server will
+continue operation. This error message may appear in main server processing
+loop.
+
 % DHCP6_PACKET_QUEUE_FULL multi-threading packet queue is full
 A debug message noting that the multi-threading packet queue is full so
 the oldest packet of the queue was dropped to make room for the received one.
index 40c99114f041ebb3274fe56bd885c4cb7411bfdf..0bf88e18a1fe55cf8b660e8117ce6b071dc3064c 100644 (file)
@@ -617,15 +617,13 @@ Dhcpv6Srv::run() {
         } catch (const std::exception& e) {
             // General catch-all standard exceptions that are not caught by more
             // specific catches.
-            LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_STD_EXCEPTION)
-                .arg("duid=[no info], [no hwaddr info], tid=[no info]")
+            LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_STD_EXCEPTION_MAIN)
                 .arg(e.what());
 
         } catch (...) {
             // General catch-all non-standard exception that are not caught
             // by more specific catches.
-            LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_EXCEPTION)
-                .arg("duid=[no info], [no hwaddr info], tid=[no info]");
+            LOG_ERROR(packet6_logger, DHCP6_PACKET_PROCESS_EXCEPTION_MAIN);
         }
     }