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

Send the device moved notification only if the attachment points belong to...

Send the device moved notification only if the attachment points belong to different broadcast domains.
parent 04d6a714
No related branches found
No related tags found
No related merge requests found
......@@ -394,17 +394,18 @@ entity.getLastSeenTimestamp().getTime());
if (oldAPs != null) oldAPList.addAll(oldAPs);
oldAPList.add(oldAP);
this.oldAPs = oldAPList;
return true; // attachment point changed.
} else {
if (!topology.isInSameBroadcastDomain(oldAP.getSw(), oldAP.getPort(),
newAP.getSw(), newAP.getPort()))
return true; // attachment point changed.
} else if (oldAPFlag) {
// retain oldAP as is. Put the newAP in oldAPs for flagging
// possible duplicates.
oldAPList = new ArrayList<AttachmentPoint>();
if (oldAPs != null) oldAPList.addAll(oldAPs);
// Add ot oldAPList only if it was picked up from the oldAPList
if (oldAPFlag) oldAPList.add(newAP);
this.oldAPs = oldAPList;
oldAPList = new ArrayList<AttachmentPoint>();
if (oldAPs != null) oldAPList.addAll(oldAPs);
// Add ot oldAPList only if it was picked up from the oldAPList
oldAPList.add(newAP);
this.oldAPs = oldAPList;
}
return false;
}
......
......@@ -770,6 +770,8 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
.anyTimes();
expect(mockTopology.getL2DomainId(1L)).andReturn(1L).anyTimes();
expect(mockTopology.getL2DomainId(5L)).andReturn(1L).anyTimes();
expect(mockTopology.isInSameBroadcastDomain(1L, (short)1, 5L, (short)2)).
andReturn(false).anyTimes();
// Start recording the replay on the mocks
replay(mockTopology);
......@@ -1498,6 +1500,11 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
EasyMock.anyShort()))
.andReturn(false)
.anyTimes();
expect(mockTopology.isInSameBroadcastDomain(EasyMock.anyLong(),
EasyMock.anyShort(),
EasyMock.anyLong(),
EasyMock.anyShort())).
andReturn(false).anyTimes();
replay(mockTopology);
Entity e1 = new Entity(1L, (short)1, null, null, null, new Date(2000));
......
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