Skip to content
Snippets Groups Projects
Commit b345527b authored by Srinivasan Ramasubramanian's avatar Srinivasan Ramasubramanian
Browse files

When a packet-in is seen on the same attachment point as before, retain the...

When a packet-in is seen on the same attachment point as before, retain the active since from the old one.
parent d61997f8
No related branches found
No related tags found
No related merge requests found
......@@ -257,7 +257,8 @@ entity.getLastSeenTimestamp().getTime());
* @return
*/
List<AttachmentPoint> getDuplicateAttachmentPoints(List<AttachmentPoint>oldAPList,
Map<Long, AttachmentPoint>apMap) { ITopologyService topology = deviceManager.topology;
Map<Long, AttachmentPoint>apMap) {
ITopologyService topology = deviceManager.topology;
List<AttachmentPoint> dupAPs = new ArrayList<AttachmentPoint>();
long timeThreshold = System.currentTimeMillis() -
AttachmentPoint.INACTIVITY_INTERVAL;
......@@ -380,8 +381,9 @@ entity.getLastSeenTimestamp().getTime());
// we need to compare oldAP and newAP.
if (oldAP.equals(newAP)) {
// nothing to do here. just the last seen has to be changed.
if (newAP.lastSeen > oldAP.lastSeen)
apMap.put(id, newAP);
if (newAP.lastSeen > oldAP.lastSeen) {
oldAP.setLastSeen(newAP.lastSeen);
}
this.attachmentPoints =
new ArrayList<AttachmentPoint>(apMap.values());
return false; // nothing to do here.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment