Skip to content
Snippets Groups Projects
Commit 92c52934 authored by Srinivasan Ramasubramanian's avatar Srinivasan Ramasubramanian Committed by Rob Adams
Browse files

If a standard LLDP comes from a different network, we should drop it. The...

If a standard LLDP comes from a different network, we should drop it.  The standard LLDP mac address could be :00, :03, :0e.
parent a33fc510
No related branches found
No related tags found
No related merge requests found
......@@ -146,6 +146,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";
......@@ -550,13 +556,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