]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3688] DHCPv4 server uses clientid from the exchange where possible.
authorMarcin Siodelski <marcin@isc.org>
Thu, 12 Mar 2015 19:20:37 +0000 (20:20 +0100)
committerMarcin Siodelski <marcin@isc.org>
Thu, 12 Mar 2015 19:20:37 +0000 (20:20 +0100)
src/bin/dhcp4/dhcp4_srv.cc

index 95a26066e3ccf87bef2091cfb45e3acbcfec5b33..a1d987c03e82268b314ac362e7596e95e6b4dbe0 100644 (file)
@@ -1067,14 +1067,8 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
     LOG_DEBUG(dhcp4_logger, DBG_DHCP4_DETAIL_DATA, DHCP4_SUBNET_SELECTED)
         .arg(subnet->toText());
 
-    // Get client-id option
-    ClientIdPtr client_id;
-    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 client-id. It is not mandatory in DHCPv4.
+    ClientIdPtr client_id = ex.getContext()->clientid_;
 
     // Get the server identifier. It will be used to determine the state
     // of the client.
@@ -1246,8 +1240,8 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
         }
 
         // IP Address Lease time (type 51)
-        opt.reset(new OptionUint32(Option::V4, DHO_DHCP_LEASE_TIME,
-                                   lease->valid_lft_));
+        OptionPtr opt(new OptionUint32(Option::V4, DHO_DHCP_LEASE_TIME,
+                                       lease->valid_lft_));
         resp->addOption(opt);
 
         // Subnet mask (type 1)