]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
minor changes
authorRazvan Becheriu <razvan.becheriu@qualitance.com>
Mon, 19 Feb 2018 17:28:03 +0000 (19:28 +0200)
committerRazvan Becheriu <razvan.becheriu@qualitance.com>
Mon, 19 Feb 2018 17:28:03 +0000 (19:28 +0200)
src/lib/dhcpsrv/mysql_lease_mgr.cc

index 049da7604314fba021725bc8a84bf44a407966ec..1970599c995d0967159a93813729e115dab04a77 100644 (file)
@@ -626,8 +626,11 @@ public:
         std::string hostname(hostname_buffer_,
                              hostname_buffer_ + hostname_length_);
 
-        // Recreate the hardware address.
-        HWAddrPtr hwaddr(new HWAddr(hwaddr_buffer_, hwaddr_length_, HTYPE_ETHER));
+        /// Set hardware address if it was set
+        HWAddrPtr hwaddr;
+        if (hwaddr_null_ == MLM_FALSE) {
+            hwaddr.reset(new HWAddr(hwaddr_buffer_, hwaddr_length_, HTYPE_ETHER));
+        }
 
         // note that T1 and T2 are not stored
         Lease4Ptr lease(new Lease4(addr4_, hwaddr,
@@ -1764,7 +1767,7 @@ MySqlLeaseMgr::getLeases4(SubnetID subnet_id) const {
 
 Lease4Collection
 MySqlLeaseMgr::getLeases4() const {
-   LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MYSQL_GET4);
+    LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE_DETAIL, DHCPSRV_MYSQL_GET4);
 
     Lease4Collection result;
     getLeaseCollection(GET_LEASE4, 0, result);