mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 06:25:34 +00:00
[3688] DHCPv4 server uses clientid from the exchange where possible.
This commit is contained in:
@@ -1067,14 +1067,8 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
|
|||||||
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_SUBNET_SELECTED)
|
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_SUBNET_SELECTED)
|
||||||
.arg(subnet->toText());
|
.arg(subnet->toText());
|
||||||
|
|
||||||
// Get client-id option
|
// Get client-id. It is not mandatory in DHCPv4.
|
||||||
ClientIdPtr client_id;
|
ClientIdPtr client_id = ex.getContext()->clientid_;
|
||||||
OptionPtr opt = query->getOption(DHO_DHCP_CLIENT_IDENTIFIER);
|
|
||||||
if (opt) {
|
|
||||||
client_id = ClientIdPtr(new ClientId(opt->getData()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// client-id is not mandatory in DHCPv4
|
|
||||||
|
|
||||||
// Get the server identifier. It will be used to determine the state
|
// Get the server identifier. It will be used to determine the state
|
||||||
// of the client.
|
// of the client.
|
||||||
@@ -1246,8 +1240,8 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// IP Address Lease time (type 51)
|
// IP Address Lease time (type 51)
|
||||||
opt.reset(new OptionUint32(Option::V4, DHO_DHCP_LEASE_TIME,
|
OptionPtr opt(new OptionUint32(Option::V4, DHO_DHCP_LEASE_TIME,
|
||||||
lease->valid_lft_));
|
lease->valid_lft_));
|
||||||
resp->addOption(opt);
|
resp->addOption(opt);
|
||||||
|
|
||||||
// Subnet mask (type 1)
|
// Subnet mask (type 1)
|
||||||
|
Reference in New Issue
Block a user