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

If an attachment point port from packet-in does not replace already known...

If an attachment point port from packet-in does not replace already known attachment point, put it in oldAP list only if it was picked up from oldAP list.  Otherwise, ignore the attachment point.
parent 4bf09d0d
No related branches found
No related tags found
No related merge requests found
......@@ -329,6 +329,7 @@ entity.getLastSeenTimestamp().getTime());
ITopologyService topology = deviceManager.topology;
List<AttachmentPoint> oldAPList;
List<AttachmentPoint> apList;
boolean oldAPFlag = false;
if (!deviceManager.isValidAttachmentPoint(sw, port)) return false;
AttachmentPoint newAP = new AttachmentPoint(sw, port, lastSeen);
......@@ -346,6 +347,7 @@ entity.getLastSeenTimestamp().getTime());
newAP = oldAPList.remove(index);
newAP.setLastSeen(lastSeen);
this.oldAPs = oldAPList;
oldAPFlag = true;
log.debug("DEVICE_MOVE: OldAPs changed for device: {}", oldAPList);
}
......@@ -404,7 +406,8 @@ entity.getLastSeenTimestamp().getTime());
// possible duplicates.
oldAPList = new ArrayList<AttachmentPoint>();
if (oldAPs != null) oldAPList.addAll(oldAPs);
oldAPList.add(newAP);
// Add ot oldAPList only if it was picked up from the oldAPList
if (oldAPFlag) oldAPList.add(newAP);
log.debug("DEVICE_MOVED: New attachment point {} does not" +
" replace already existing one {}.", newAP, oldAP);
this.oldAPs = oldAPList;
......
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