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

Device manager will learn new attachment points only if the switch ports do...

Device manager will learn new attachment points only if the switch ports do not belong to the same broadcast domain.
parent b07d9b10
No related branches found
No related tags found
No related merge requests found
......@@ -1069,7 +1069,11 @@ public class DeviceManagerImpl implements IDeviceManagerService, IOFMessageListe
// If two ports are in the same port-channel, we don't treat it
// as conflict, but will forward based on the last seen switch-port
if (!devMgrMaps.inSamePortChannel(swPort,
curAttachmentPoint.getSwitchPort())) {
curAttachmentPoint.getSwitchPort()) &&
!topology.isInSameBroadcastDomain(swPort.getSw().getId(),
swPort.getPort(),
curAttachmentPoint.getSwitchPort().getSw().getId(),
curAttachmentPoint.getSwitchPort().getPort())) {
curAttachmentPoint.setConflict(currentDate);
if (curAttachmentPoint.isFlapping()) {
curAttachmentPoint.setBlocked(true);
......
......@@ -40,4 +40,6 @@ public interface ITopologyService extends IFloodlightService {
public void addListener(ITopologyListener listener);
public boolean isIncomingBroadcastAllowedOnSwitchPort(long sw, short portId);
public boolean isInSameBroadcastDomain(long s1, short p1, long s2, short p2);
}
......@@ -384,5 +384,11 @@ IRoutingService, ILinkDiscoveryListener {
public BroadcastTree getBroadcastTreeForCluster(long clusterId) {
return currentInstance.getBroadcastTreeForCluster(clusterId);
}
@Override
public boolean isInSameBroadcastDomain(long s1, short p1, long s2, short p2) {
// TODO Auto-generated method stub
return false;
}
}
......@@ -450,6 +450,8 @@ public class DeviceManagerImplTest extends FloodlightTestCase {
deviceManager.setTopology(mockTopology);
// Start recording the replay on the mocks
expect(mockTopology.isInSameBroadcastDomain((long)1, (short)2, (long)1, (short)1)).andReturn(false).anyTimes();
expect(mockTopology.isInSameBroadcastDomain((long)1, (short)1, (long)1, (short)2)).andReturn(false).anyTimes();
replay(mockSwitch, mockTopology);
// Get the listener and trigger the packet in
......
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