commit | 946b8cdf8ef4f180ac1ab4b1fd8719aae66f6560 | [log] [tgz] |
---|---|---|
author | Daniel Ginsburg <daniel.ginsburg@harmonicinc.com> | Wed May 16 08:02:06 2018 +0300 |
committer | Charles Chan <charles@opennetworking.org> | Mon May 21 21:16:44 2018 +0000 |
tree | 4e314abadff995528f1989d0d9da4d55793a9575 | |
parent | f746c871e83799ac54db70fce246856ade2f7908 [diff] |
Make sure that HostLocation's timestamp is updated Make sure that the most recent timestamp of location is recorded in DhcpStore when this location is already present in locations set. Change-Id: Idfc768d9812ef3cb01cc8a7a3d7778a3e3bd5caf (cherry picked from commit bd1472dc540d5aa61d4dd9bf7b4705cf5ff7f3d8)
diff --git a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/store/DhcpRecord.java b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/store/DhcpRecord.java index e4c2673..f0beff9 100644 --- a/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/store/DhcpRecord.java +++ b/apps/dhcprelay/src/main/java/org/onosproject/dhcprelay/store/DhcpRecord.java
@@ -95,6 +95,9 @@ * @return the DHCP record */ public DhcpRecord addLocation(HostLocation location) { + if (locations.contains(location)) { + locations.remove(location); + } locations.add(location); return this; }