daniel
Committed by Gerrit Code Review

[Falcon] Dhcp Bug Fix

- buildReply method refers the leasetime stored in ipAssignment

Change-Id: If0477861696bd76b3c1c14983f013968b4b8e8eb
......@@ -354,7 +354,8 @@ public class DhcpManager implements DhcpService {
option = new DHCPOption();
option.setCode(DHCP.DHCPOptionCode.OptionCode_LeaseTime.getValue());
option.setLength((byte) 4);
option.setData(ByteBuffer.allocate(4).putInt(leaseTime).array());
option.setData(ByteBuffer.allocate(4)
.putInt(ipAssignment == null ? leaseTime : ipAssignment.leasePeriod()).array());
optionList.add(option);
// IP Address Renewal Time.
......
......@@ -208,7 +208,7 @@ public class DistributedDhcpStore implements DhcpStore {
assignment = IpAssignment.builder()
.ipAddress(ipAddr)
.timestamp(new Date())
.leasePeriod(leaseTime)
.leasePeriod(existingAssignment.leasePeriod())
.rangeNotEnforced(true)
.assignmentStatus(IpAssignment.AssignmentStatus.Option_RangeNotEnforced)
.subnetMask(existingAssignment.subnetMask())
......