block packet context after handling lldp
diff --git a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
index 2f0d5d8..2e8fa55 100644
--- a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
+++ b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
@@ -277,7 +277,7 @@
* Handles an incoming LLDP packet. Creates link in topology and sends ACK
* to port where LLDP originated.
*/
- public void handleLLDP(final byte[] pkt, Integer inPort) {
+ public boolean handleLLDP(final byte[] pkt, Integer inPort) {
short ethType = ONLabLddp.isOVXLLDP(pkt);
if (ethType == Ethernet.TYPE_LLDP || ethType == Ethernet.TYPE_BSN) {
@@ -286,7 +286,7 @@
final OpenFlowSwitch srcSwitch = ctrl.getSwitch(new Dpid(dp.getDpid()));
final Integer srcPort = dp.getPort();
if (srcSwitch == null) {
- return;
+ return true;
}
this.ackProbe(srcPort);
ConnectPoint src = new ConnectPoint(
@@ -303,8 +303,10 @@
ld = new DefaultLinkDescription(src, dst, Type.DIRECT);
}
linkProvider.linkDetected(ld);
+ return true;
} else {
this.log.debug("Ignoring unknown LLDP");
+ return false;
}
}
diff --git a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java
index 2de4b8c..99ae8ce 100644
--- a/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java
+++ b/providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java
@@ -87,8 +87,9 @@
if (ld == null) {
return;
}
- ld.handleLLDP(pktCtx.unparsed(),
- pktCtx.inPort());
+ if (ld.handleLLDP(pktCtx.unparsed(), pktCtx.inPort())) {
+ pktCtx.block();
+ }
}