Skip to content

Commit

Permalink
[#2820] addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pzadroga committed Apr 26, 2024
1 parent 45eccb3 commit 9b4a2d2
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/bin/dhcp4/dhcp4_messages.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/bin/dhcp4/dhcp4_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions src/bin/dhcp4/dhcp4_messages.mes
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions src/bin/dhcp4/dhcp4_srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/bin/dhcp6/dhcp6_messages.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions src/bin/dhcp6/dhcp6_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 14 additions & 0 deletions src/bin/dhcp6/dhcp6_messages.mes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
6 changes: 2 additions & 4 deletions src/bin/dhcp6/dhcp6_srv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 9b4a2d2

Please sign in to comment.