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

Merge pull request #182 from sriniram/master

Drop any LLDP with :00, :03, :0e coming from another network.
parents 9faa803c 44cb8602
No related branches found
No related tags found
No related merge requests found
......@@ -144,6 +144,12 @@ public class LinkDiscoveryManager
protected SingletonTask sendLLDPTask;
private static final byte[] LLDP_STANDARD_DST_MAC_STRING =
HexString.fromHexString("01:80:c2:00:00:0e");
private static final byte[] LLDP_STANDARD_DST_MAC_STRING_00 =
HexString.fromHexString("01:80:c2:00:00:00");
private static final byte[] LLDP_STANDARD_DST_MAC_STRING_03 =
HexString.fromHexString("01:80:c2:00:00:03");
private static final byte[] LLDP_STANDARD_DST_MAC_STRING_0E =
HexString.fromHexString("01:80:c2:00:00:0e");
// BigSwitch OUI is 5C:16:C7, so 5D:16:C7 is the multicast version
// private static final String LLDP_BSN_DST_MAC_STRING = "5d:16:c7:00:00:01";
private static final String LLDP_BSN_DST_MAC_STRING = "ff:ff:ff:ff:ff:ff";
......@@ -548,13 +554,18 @@ public class LinkDiscoveryManager
return handleLldp((LLDP) eth.getPayload(), sw, pi, false, cntx);
} else if (eth.getEtherType() == Ethernet.TYPE_LLDP) {
return handleLldp((LLDP) eth.getPayload(), sw, pi, true, cntx);
} else if (eth.getEtherType() < 1500 &&
Arrays.equals(eth.getDestinationMACAddress(),
LLDP_STANDARD_DST_MAC_STRING)) {
// drop any other link discovery/spanning tree protocols
return Command.STOP;
} else if (eth.getEtherType() < 1500) {
if (Arrays.equals(eth.getDestinationMACAddress(),
LLDP_STANDARD_DST_MAC_STRING_00) ||
Arrays.equals(eth.getDestinationMACAddress(),
LLDP_STANDARD_DST_MAC_STRING_03) ||
Arrays.equals(eth.getDestinationMACAddress(),
LLDP_STANDARD_DST_MAC_STRING_0E)) {
// drop any other link discovery/spanning tree protocols
return Command.STOP;
}
}
return Command.CONTINUE;
}
......
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