Showing
2 changed files
with
11 additions
and
3 deletions
... | @@ -34,8 +34,7 @@ public interface Instruction { | ... | @@ -34,8 +34,7 @@ public interface Instruction { |
34 | // to create specific instructions. | 34 | // to create specific instructions. |
35 | 35 | ||
36 | /** | 36 | /** |
37 | - * Returns the type of instruction not to be confused | 37 | + * Returns the type of instruction. |
38 | - * with the instruction's java type. | ||
39 | * @return type of instruction | 38 | * @return type of instruction |
40 | */ | 39 | */ |
41 | public Type type(); | 40 | public Type type(); | ... | ... |
... | @@ -228,6 +228,9 @@ public class LinkDiscovery implements TimerTask { | ... | @@ -228,6 +228,9 @@ public class LinkDiscovery implements TimerTask { |
228 | * @return Packet_out message with LLDP data | 228 | * @return Packet_out message with LLDP data |
229 | */ | 229 | */ |
230 | private OFPacketOut createLLDPPacketOut(final OFPortDesc port) { | 230 | private OFPacketOut createLLDPPacketOut(final OFPortDesc port) { |
231 | + if (port == null) { | ||
232 | + return null; | ||
233 | + } | ||
231 | OFPacketOut.Builder packetOut = this.ofFactory.buildPacketOut(); | 234 | OFPacketOut.Builder packetOut = this.ofFactory.buildPacketOut(); |
232 | packetOut.setBufferId(OFBufferId.NO_BUFFER); | 235 | packetOut.setBufferId(OFBufferId.NO_BUFFER); |
233 | OFAction act = this.ofFactory.actions().buildOutput() | 236 | OFAction act = this.ofFactory.actions().buildOutput() |
... | @@ -248,6 +251,9 @@ public class LinkDiscovery implements TimerTask { | ... | @@ -248,6 +251,9 @@ public class LinkDiscovery implements TimerTask { |
248 | * @return Packet_out message with LLDP data | 251 | * @return Packet_out message with LLDP data |
249 | */ | 252 | */ |
250 | private OFPacketOut createBDDPPacketOut(final OFPortDesc port) { | 253 | private OFPacketOut createBDDPPacketOut(final OFPortDesc port) { |
254 | + if (port == null) { | ||
255 | + return null; | ||
256 | + } | ||
251 | OFPacketOut.Builder packetOut = sw.factory().buildPacketOut(); | 257 | OFPacketOut.Builder packetOut = sw.factory().buildPacketOut(); |
252 | 258 | ||
253 | packetOut.setBufferId(OFBufferId.NO_BUFFER); | 259 | packetOut.setBufferId(OFBufferId.NO_BUFFER); |
... | @@ -267,6 +273,9 @@ public class LinkDiscovery implements TimerTask { | ... | @@ -267,6 +273,9 @@ public class LinkDiscovery implements TimerTask { |
267 | 273 | ||
268 | 274 | ||
269 | private void sendMsg(final OFMessage msg) { | 275 | private void sendMsg(final OFMessage msg) { |
276 | + if (msg == null) { | ||
277 | + return; | ||
278 | + } | ||
270 | this.sw.sendMsg(msg); | 279 | this.sw.sendMsg(msg); |
271 | } | 280 | } |
272 | 281 | ||
... | @@ -389,8 +398,8 @@ public class LinkDiscovery implements TimerTask { | ... | @@ -389,8 +398,8 @@ public class LinkDiscovery implements TimerTask { |
389 | } | 398 | } |
390 | 399 | ||
391 | public void stop() { | 400 | public void stop() { |
392 | - removeAllPorts(); | ||
393 | timeout.cancel(); | 401 | timeout.cancel(); |
402 | + removeAllPorts(); | ||
394 | } | 403 | } |
395 | 404 | ||
396 | } | 405 | } | ... | ... |
-
Please register or login to post a comment