]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3737] Fixed the logging message when the lease allocation fails.
authorMarcin Siodelski <marcin@isc.org>
Tue, 17 Mar 2015 18:39:11 +0000 (19:39 +0100)
committerMarcin Siodelski <marcin@isc.org>
Tue, 17 Mar 2015 18:39:11 +0000 (19:39 +0100)
Log the ciaddr and requested-ip-address if exists. Previously the message
said it logged yiaddr sent by the client, but the client doesn't set the
yiaddr.

src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_srv.cc

index 3aa3fad7876a887bea0d278c11c0a4c9ca1da0c0..a15909f1cf4f8506be9bee735010e1494ef24fda 100644 (file)
@@ -168,7 +168,7 @@ a lease. It is up to the client to choose one server out of other advertised
 and continue allocation with that server. This is a normal behavior and
 indicates successful operation.
 
-% DHCP4_LEASE_ADVERT_FAIL failed to advertise a lease for client client-id %1, hwaddr %2, client sent yiaddr %3
+% DHCP4_LEASE_ADVERT_FAIL failed to advertise a lease for client-id %1, hwaddr %2, client sent ciaddr %3, requested-ip-address %4
 This message indicates that the server has failed to offer a lease to
 the specified client after receiving a DISCOVER message from it. There are
 many possible reasons for such a failure.
@@ -178,7 +178,7 @@ This debug message indicates that the server successfully granted a lease
 in response to client's REQUEST message. This is a normal behavior and
 indicates successful operation.
 
-% DHCP4_LEASE_ALLOC_FAIL failed to grant a lease for client-id %1, hwaddr %2, client sent yiaddr %3
+% DHCP4_LEASE_ALLOC_FAIL failed to grant a lease for client-id %1, hwaddr %2, client sent ciaddr %3, requested-ip-address %4
 This message indicates that the server failed to grant a lease to the
 specified client after receiving a REQUEST message from it.  There are many
 possible reasons for such a failure. Additional messages will indicate the
index 532376f0ca1f6d85bda54dbfe2d18b7dd64e3d46..914e46ed13833c08c65e82601123804b00c2a204 100644 (file)
@@ -1092,7 +1092,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
     if (opt_requested_address) {
         hint = opt_requested_address->readAddress();
 
-    } else if (query->getCiaddr() != IOAddress::IPV4_ZERO_ADDRESS()) {
+    } else if (!query->getCiaddr().isV4Zero()) {
         hint = query->getCiaddr();
 
     }
@@ -1292,7 +1292,9 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
                   DHCP4_LEASE_ADVERT_FAIL:DHCP4_LEASE_ALLOC_FAIL)
             .arg(client_id?client_id->toText():"(no client-id)")
             .arg(hwaddr?hwaddr->toText():"(no hwaddr info)")
-            .arg(hint.toText());
+            .arg(query->getCiaddr().toText())
+            .arg(opt_requested_address ?
+                 opt_requested_address->readAddress().toText() : "(no address)");
 
         resp->setType(DHCPNAK);
         resp->setYiaddr(IOAddress::IPV4_ZERO_ADDRESS());