]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2918] added message for requested address on DHCPDISCOVER
authorRazvan Becheriu <razvan@isc.org>
Wed, 4 Oct 2023 06:45:47 +0000 (09:45 +0300)
committerRazvan Becheriu <razvan@isc.org>
Fri, 6 Oct 2023 13:06:34 +0000 (16:06 +0300)
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_srv.cc

index 0d37e69aaf4340cc5dc82fc14dcec4355049cac6..8765442cbe03d0249ca49c869160ae7d92275c44 100644 (file)
@@ -69,6 +69,7 @@ extern const isc::log::MessageID DHCP4_DHCP4O6_RESPONSE_DATA = "DHCP4_DHCP4O6_RE
 extern const isc::log::MessageID DHCP4_DHCP4O6_SUBNET_DATA = "DHCP4_DHCP4O6_SUBNET_DATA";
 extern const isc::log::MessageID DHCP4_DHCP4O6_SUBNET_SELECTED = "DHCP4_DHCP4O6_SUBNET_SELECTED";
 extern const isc::log::MessageID DHCP4_DHCP4O6_SUBNET_SELECTION_FAILED = "DHCP4_DHCP4O6_SUBNET_SELECTION_FAILED";
+extern const isc::log::MessageID DHCP4_DISCOVER = "DHCP4_DISCOVER";
 extern const isc::log::MessageID DHCP4_DYNAMIC_RECONFIGURATION = "DHCP4_DYNAMIC_RECONFIGURATION";
 extern const isc::log::MessageID DHCP4_DYNAMIC_RECONFIGURATION_FAIL = "DHCP4_DYNAMIC_RECONFIGURATION_FAIL";
 extern const isc::log::MessageID DHCP4_DYNAMIC_RECONFIGURATION_SUCCESS = "DHCP4_DYNAMIC_RECONFIGURATION_SUCCESS";
@@ -97,8 +98,8 @@ extern const isc::log::MessageID DHCP4_HOOK_SUBNET4_SELECT_SKIP = "DHCP4_HOOK_SU
 extern const isc::log::MessageID DHCP4_INFORM_DIRECT_REPLY = "DHCP4_INFORM_DIRECT_REPLY";
 extern const isc::log::MessageID DHCP4_INIT_FAIL = "DHCP4_INIT_FAIL";
 extern const isc::log::MessageID DHCP4_INIT_REBOOT = "DHCP4_INIT_REBOOT";
-extern const isc::log::MessageID DHCP4_LEASE_ADVERT = "DHCP4_LEASE_ADVERT";
 extern const isc::log::MessageID DHCP4_LEASE_ALLOC = "DHCP4_LEASE_ALLOC";
+extern const isc::log::MessageID DHCP4_LEASE_OFFER = "DHCP4_LEASE_OFFER";
 extern const isc::log::MessageID DHCP4_LEASE_REUSE = "DHCP4_LEASE_REUSE";
 extern const isc::log::MessageID DHCP4_MULTI_THREADING_INFO = "DHCP4_MULTI_THREADING_INFO";
 extern const isc::log::MessageID DHCP4_NCR_CREATION_FAILED = "DHCP4_NCR_CREATION_FAILED";
@@ -245,6 +246,7 @@ const char* values[] = {
     "DHCP4_DHCP4O6_SUBNET_DATA", "%1: the selected subnet details: %2",
     "DHCP4_DHCP4O6_SUBNET_SELECTED", "%1: the subnet with ID %2 was selected for client assignments",
     "DHCP4_DHCP4O6_SUBNET_SELECTION_FAILED", "%1: failed to select subnet for the client",
+    "DHCP4_DISCOVER", "%1: server is processing DHCPDISCOVER with hint=%2",
     "DHCP4_DYNAMIC_RECONFIGURATION", "initiate server reconfiguration using file: %1, after receiving SIGHUP signal or config-reload command",
     "DHCP4_DYNAMIC_RECONFIGURATION_FAIL", "dynamic server reconfiguration failed with file: %1",
     "DHCP4_DYNAMIC_RECONFIGURATION_SUCCESS", "dynamic server reconfiguration succeeded with file: %1",
@@ -273,8 +275,8 @@ const char* values[] = {
     "DHCP4_INFORM_DIRECT_REPLY", "%1: DHCPACK in reply to the DHCPINFORM will be sent directly to %2 over %3",
     "DHCP4_INIT_FAIL", "failed to initialize Kea server: %1",
     "DHCP4_INIT_REBOOT", "%1: client is in INIT-REBOOT state and requests address %2",
-    "DHCP4_LEASE_ADVERT", "%1: lease %2 will be advertised",
     "DHCP4_LEASE_ALLOC", "%1: lease %2 has been allocated for %3 seconds",
+    "DHCP4_LEASE_OFFER", "%1: lease %2 will be offered",
     "DHCP4_LEASE_REUSE", "%1: lease %2 has been reused for %3 seconds",
     "DHCP4_MULTI_THREADING_INFO", "enabled: %1, number of threads: %2, queue size: %3",
     "DHCP4_NCR_CREATION_FAILED", "%1: failed to generate name change requests for DNS: %2",
index 785fccb21c2efdf6447e2ff08e28ffe10b680142..45b69867b3aa1e19d54498ee2bb8754ffb6e68ab 100644 (file)
@@ -70,6 +70,7 @@ extern const isc::log::MessageID DHCP4_DHCP4O6_RESPONSE_DATA;
 extern const isc::log::MessageID DHCP4_DHCP4O6_SUBNET_DATA;
 extern const isc::log::MessageID DHCP4_DHCP4O6_SUBNET_SELECTED;
 extern const isc::log::MessageID DHCP4_DHCP4O6_SUBNET_SELECTION_FAILED;
+extern const isc::log::MessageID DHCP4_DISCOVER;
 extern const isc::log::MessageID DHCP4_DYNAMIC_RECONFIGURATION;
 extern const isc::log::MessageID DHCP4_DYNAMIC_RECONFIGURATION_FAIL;
 extern const isc::log::MessageID DHCP4_DYNAMIC_RECONFIGURATION_SUCCESS;
@@ -98,8 +99,8 @@ extern const isc::log::MessageID DHCP4_HOOK_SUBNET4_SELECT_SKIP;
 extern const isc::log::MessageID DHCP4_INFORM_DIRECT_REPLY;
 extern const isc::log::MessageID DHCP4_INIT_FAIL;
 extern const isc::log::MessageID DHCP4_INIT_REBOOT;
-extern const isc::log::MessageID DHCP4_LEASE_ADVERT;
 extern const isc::log::MessageID DHCP4_LEASE_ALLOC;
+extern const isc::log::MessageID DHCP4_LEASE_OFFER;
 extern const isc::log::MessageID DHCP4_LEASE_REUSE;
 extern const isc::log::MessageID DHCP4_MULTI_THREADING_INFO;
 extern const isc::log::MessageID DHCP4_NCR_CREATION_FAILED;
index f432c06c8086e7f11c5e429e7f3b7eb67bdb972f..8dea2733a2c4abce65578cd2ce89df61cdff712a 100644 (file)
@@ -536,13 +536,21 @@ state and is requesting an IPv4 address it is using to be allocated for it.
 The first argument includes the client and transaction identification
 information. The second argument specifies the requested IPv4 address.
 
-% DHCP4_LEASE_ADVERT %1: lease %2 will be advertised
+% DHCP4_LEASE_OFFER %1: lease %2 will be offered
 This informational message indicates that the server has found the lease to be
 offered to the client. It is up to the client to choose one server out of
 those which offered leases and continue allocation with that server.
 The first argument specifies the client and the transaction identification
 information. The second argument specifies the IPv4 address to be offered.
 
+% DHCP4_DISCOVER %1: server is processing DHCPDISCOVER with hint=%2
+This is a debug message that indicates the processing of a received DHCPDISCOVER
+message. The first argument contains the client and the transaction
+identification information. The second 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.
+
 % DHCP4_LEASE_ALLOC %1: lease %2 has been allocated for %3 seconds
 This informational message indicates that the server successfully granted a
 lease in response to client's DHCPREQUEST message. The lease information will
index d017dbb27f1e22d9850b333df28f32586c787a73..bc24f72d7a3ada6dd2c6e20011874d7009d0aa5f 100644 (file)
@@ -2664,6 +2664,10 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
                 authoritative = flag->boolValue();
             }
         }
+    } else if (fake_allocation) {
+        LOG_DEBUG(lease4_logger, DBG_DHCP4_DETAIL, DHCP4_DISCOVER)
+            .arg(query->getLabel())
+            .arg(hint != IOAddress::IPV4_ZERO_ADDRESS() ? hint.toText() : "(no hint)");
     }
 
     // If there is no subnet configuration for that client we ignore the
@@ -2865,7 +2869,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
         // We have a lease! Let's set it in the packet and send it back to
         // the client.
         if (fake_allocation) {
-            LOG_INFO(lease4_logger, DHCP4_LEASE_ADVERT)
+            LOG_INFO(lease4_logger, DHCP4_LEASE_OFFER)
                 .arg(query->getLabel())
                 .arg(lease->addr_.toText());
         } else {