commit | 70ce84382423823a5b42003def8a71d9d1a4d24a | [log] [tgz] |
---|---|---|
author | Yuta HIGUCHI <y-higuchi@onlab.us> | Wed Oct 15 23:59:10 2014 -0700 |
committer | Yuta HIGUCHI <y-higuchi@onlab.us> | Wed Oct 15 23:59:10 2014 -0700 |
tree | 475c0283ddf25296f6a17a4be497ef500652c5c3 | |
parent | 7f3df231e19fbac17da8357832c643dcc2d049a1 [diff] |
attempt to fix NPE in LinkDiscovery Change-Id: Iec3e2ed4a0fee2fb0c6ad9a0e383c2024efc10a0
diff --git a/providers/openflow/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java b/providers/openflow/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java index 0c4502b..bc45f79 100644 --- a/providers/openflow/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java +++ b/providers/openflow/link/src/main/java/org/onlab/onos/provider/of/link/impl/LinkDiscovery.java
@@ -339,9 +339,14 @@ final Iterator<Integer> fastIterator = this.fastPorts.iterator(); while (fastIterator.hasNext()) { final Integer portNumber = fastIterator.next(); + OFPortDesc port = findPort(portNumber); + if (port == null) { + // port can be null + // #removePort modifies `ports` outside synchronized block + continue; + } final int probeCount = this.portProbeCount.get(portNumber) .getAndIncrement(); - OFPortDesc port = findPort(portNumber); if (probeCount < LinkDiscovery.MAX_PROBE_COUNT) { this.log.debug("sending fast probe to port");