From: Razvan Becheriu Date: Fri, 6 Oct 2023 13:16:14 +0000 (+0300) Subject: [#2918] added more log messages X-Git-Tag: Kea-2.5.3~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b6d178c56eadcabcb83cc454da87fdf031971db9;p=thirdparty%2Fkea.git [#2918] added more log messages --- diff --git a/ChangeLog b/ChangeLog index 2f6714f113..1a5fcb6e6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2185. [func] razvan + Added extended log messages: DHCP4_DISCOVER, DHCP4_REQUEST, + DHCP6_PROCESS_IA_NA_SOLICIT, DHCP6_PROCESS_IA_PD_SOLICIT, which + include the hint address in the client request. The log message + tag DHCP4_LEASE_ADVERT has been renamed to DHCP4_LEASE_OFFER. + (Gitlab #2918) + 2184. [bug] razvan Fixed a bug in evaluated expression parser which was not propelry handling escaped null characters. diff --git a/src/bin/dhcp6/dhcp6_messages.cc b/src/bin/dhcp6/dhcp6_messages.cc index 94d208ea85..091a822628 100644 --- a/src/bin/dhcp6/dhcp6_messages.cc +++ b/src/bin/dhcp6/dhcp6_messages.cc @@ -133,8 +133,10 @@ extern const isc::log::MessageID DHCP6_PD_LEASE_REUSE = "DHCP6_PD_LEASE_REUSE"; extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_EXTEND = "DHCP6_PROCESS_IA_NA_EXTEND"; extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_RELEASE = "DHCP6_PROCESS_IA_NA_RELEASE"; extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_REQUEST = "DHCP6_PROCESS_IA_NA_REQUEST"; +extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_SOLICIT = "DHCP6_PROCESS_IA_NA_SOLICIT"; extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_EXTEND = "DHCP6_PROCESS_IA_PD_EXTEND"; extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_REQUEST = "DHCP6_PROCESS_IA_PD_REQUEST"; +extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_SOLICIT = "DHCP6_PROCESS_IA_PD_SOLICIT"; extern const isc::log::MessageID DHCP6_QUERY_DATA = "DHCP6_QUERY_DATA"; extern const isc::log::MessageID DHCP6_QUERY_LABEL = "DHCP6_QUERY_LABEL"; extern const isc::log::MessageID DHCP6_RAPID_COMMIT = "DHCP6_RAPID_COMMIT"; @@ -304,8 +306,10 @@ const char* values[] = { "DHCP6_PROCESS_IA_NA_EXTEND", "%1: extending lease lifetime for IA_NA option with iaid=%2", "DHCP6_PROCESS_IA_NA_RELEASE", "%1: releasing lease for IA_NA option with iaid=%2", "DHCP6_PROCESS_IA_NA_REQUEST", "%1: server is processing IA_NA option with iaid=%2 and hint=%3", + "DHCP6_PROCESS_IA_NA_SOLICIT", "%1: server is processing IA_NA option with iaid=%2 and hint=%3", "DHCP6_PROCESS_IA_PD_EXTEND", "%1: extending lease lifetime for IA_PD option with iaid=%2", "DHCP6_PROCESS_IA_PD_REQUEST", "%1: server is processing IA_PD option with iaid=%2 and hint=%3", + "DHCP6_PROCESS_IA_PD_SOLICIT", "%1: server is processing IA_PD option with iaid=%2 and hint=%3", "DHCP6_QUERY_DATA", "%1, packet details: %2", "DHCP6_QUERY_LABEL", "received query: %1", "DHCP6_RAPID_COMMIT", "%1: Rapid Commit option received, following 2-way exchange", diff --git a/src/bin/dhcp6/dhcp6_messages.h b/src/bin/dhcp6/dhcp6_messages.h index 26b9f108cb..88e86e7c9a 100644 --- a/src/bin/dhcp6/dhcp6_messages.h +++ b/src/bin/dhcp6/dhcp6_messages.h @@ -134,8 +134,10 @@ extern const isc::log::MessageID DHCP6_PD_LEASE_REUSE; extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_EXTEND; extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_RELEASE; extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_REQUEST; +extern const isc::log::MessageID DHCP6_PROCESS_IA_NA_SOLICIT; extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_EXTEND; extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_REQUEST; +extern const isc::log::MessageID DHCP6_PROCESS_IA_PD_SOLICIT; extern const isc::log::MessageID DHCP6_QUERY_DATA; extern const isc::log::MessageID DHCP6_QUERY_LABEL; extern const isc::log::MessageID DHCP6_RAPID_COMMIT; diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index 80e0d008a6..4ddbd27da5 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -782,6 +782,15 @@ about the address that the client would like to have allocated. If there is no hint, the argument should provide the text indicating that the hint hasn't been sent. +% DHCP6_PROCESS_IA_NA_SOLICIT %1: server is processing IA_NA option with iaid=%2 and hint=%3 +This is a debug message that indicates the processing of a received +IA_NA option. The first argument contains the client and the transaction +identification information. The second argument holds the IAID of the +IA_NA option. The third argument may hold the hint for the server +about the address that the client would like to have allocated. +If there is no hint, the argument should provide the text indicating +that the hint hasn't been sent. + % DHCP6_PROCESS_IA_PD_EXTEND %1: extending lease lifetime for IA_PD option with iaid=%2 This message is logged when the server is starting to extend the lifetime of the prefix lease associated with the particular IAID. The first argument @@ -797,6 +806,15 @@ about the prefix that the client would like to have allocated. If there is no hint, the argument should provide the text indicating that the hint hasn't been sent. +% DHCP6_PROCESS_IA_PD_SOLICIT %1: server is processing IA_PD option with iaid=%2 and hint=%3 +This is a debug message that indicates a processing of received IA_PD +option. The first argument contains the client and the transaction +identification information. The second argument holds the IAID of the +IA_PD option. The third argument may hold the hint for the server +about the prefix that the client would like to have allocated. +If there is no hint, the argument should provide the text indicating +that the hint hasn't been sent. + % DHCP6_QUERY_DATA %1, packet details: %2 A debug message printing the details of the received packet. The first argument includes the client and the transaction identification diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc index 29fa2df6a2..8bf504541a 100644 --- a/src/bin/dhcp6/dhcp6_srv.cc +++ b/src/bin/dhcp6/dhcp6_srv.cc @@ -2340,10 +2340,17 @@ Dhcpv6Srv::assignIA_NA(const Pkt6Ptr& query, hint = hint_opt->getAddress(); } - LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_REQUEST) - .arg(query->getLabel()) - .arg(ia->getIAID()) - .arg(hint_opt ? hint.toText() : "(no hint)"); + if (ctx.fake_allocation_) { + LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_SOLICIT) + .arg(query->getLabel()) + .arg(ia->getIAID()) + .arg(hint_opt ? hint.toText() : "(no hint)"); + } else { + LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_NA_REQUEST) + .arg(query->getLabel()) + .arg(ia->getIAID()) + .arg(hint_opt ? hint.toText() : "(no hint)"); + } // convenience values const Subnet6Ptr& subnet = ctx.subnet_; @@ -2474,10 +2481,17 @@ Dhcpv6Srv::assignIA_PD(const Pkt6Ptr& query, hint = hint_opt->getAddress(); } - LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_REQUEST) - .arg(query->getLabel()) - .arg(ia->getIAID()) - .arg(hint_opt ? hint.toText() : "(no hint)"); + if (ctx.fake_allocation_) { + LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_SOLICIT) + .arg(query->getLabel()) + .arg(ia->getIAID()) + .arg(hint_opt ? hint.toText() : "(no hint)"); + } else { + LOG_DEBUG(lease6_logger, DBG_DHCP6_DETAIL, DHCP6_PROCESS_IA_PD_REQUEST) + .arg(query->getLabel()) + .arg(ia->getIAID()) + .arg(hint_opt ? hint.toText() : "(no hint)"); + } const Subnet6Ptr& subnet = ctx.subnet_;