Commit ac1832cd authored by Marcin Siodelski's avatar Marcin Siodelski
Browse files

[3737] Fixed the logging message when the lease allocation fails.

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.
parent 6fc6f278
...@@ -168,7 +168,7 @@ a lease. It is up to the client to choose one server out of other advertised ...@@ -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 and continue allocation with that server. This is a normal behavior and
indicates successful operation. 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 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 the specified client after receiving a DISCOVER message from it. There are
many possible reasons for such a failure. many possible reasons for such a failure.
...@@ -178,7 +178,7 @@ This debug message indicates that the server successfully granted a lease ...@@ -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 in response to client's REQUEST message. This is a normal behavior and
indicates successful operation. 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 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 specified client after receiving a REQUEST message from it. There are many
possible reasons for such a failure. Additional messages will indicate the possible reasons for such a failure. Additional messages will indicate the
......
...@@ -1092,7 +1092,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) { ...@@ -1092,7 +1092,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
if (opt_requested_address) { if (opt_requested_address) {
hint = opt_requested_address->readAddress(); hint = opt_requested_address->readAddress();
} else if (query->getCiaddr() != IOAddress::IPV4_ZERO_ADDRESS()) { } else if (!query->getCiaddr().isV4Zero()) {
hint = query->getCiaddr(); hint = query->getCiaddr();
} }
...@@ -1292,7 +1292,9 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) { ...@@ -1292,7 +1292,9 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
DHCP4_LEASE_ADVERT_FAIL:DHCP4_LEASE_ALLOC_FAIL) DHCP4_LEASE_ADVERT_FAIL:DHCP4_LEASE_ALLOC_FAIL)
.arg(client_id?client_id->toText():"(no client-id)") .arg(client_id?client_id->toText():"(no client-id)")
.arg(hwaddr?hwaddr->toText():"(no hwaddr info)") .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->setType(DHCPNAK);
resp->setYiaddr(IOAddress::IPV4_ZERO_ADDRESS()); resp->setYiaddr(IOAddress::IPV4_ZERO_ADDRESS());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment