Jon Hall

[ONOS-2880] Initialize SuppressionRules before use

Change-Id: Icefce8109faa1732a5d2c7989695874775926977
...@@ -239,6 +239,7 @@ public class LLDPLinkProvider extends AbstractProvider implements LinkProvider { ...@@ -239,6 +239,7 @@ public class LLDPLinkProvider extends AbstractProvider implements LinkProvider {
239 deviceService.addListener(deviceListener); 239 deviceService.addListener(deviceListener);
240 packetService.addProcessor(packetProcessor, PacketProcessor.advisor(0)); 240 packetService.addProcessor(packetProcessor, PacketProcessor.advisor(0));
241 241
242 + loadSuppressionRules();
242 loadDevices(); 243 loadDevices();
243 244
244 executor = newSingleThreadScheduledExecutor(groupedThreads("onos/link", "discovery-%d")); 245 executor = newSingleThreadScheduledExecutor(groupedThreads("onos/link", "discovery-%d"));
...@@ -247,7 +248,6 @@ public class LLDPLinkProvider extends AbstractProvider implements LinkProvider { ...@@ -247,7 +248,6 @@ public class LLDPLinkProvider extends AbstractProvider implements LinkProvider {
247 executor.scheduleAtFixedRate(new LinkPrunerTask(), 248 executor.scheduleAtFixedRate(new LinkPrunerTask(),
248 LINK_PRUNER_DELAY, LINK_PRUNER_DELAY, SECONDS); 249 LINK_PRUNER_DELAY, LINK_PRUNER_DELAY, SECONDS);
249 250
250 - loadSuppressionRules();
251 requestIntercepts(); 251 requestIntercepts();
252 } 252 }
253 253
......
...@@ -104,8 +104,12 @@ class LinkDiscovery implements TimerTask { ...@@ -104,8 +104,12 @@ class LinkDiscovery implements TimerTask {
104 } 104 }
105 105
106 synchronized void stop() { 106 synchronized void stop() {
107 - isStopped = true; 107 + if (!isStopped) {
108 - timeout.cancel(); 108 + isStopped = true;
109 + timeout.cancel();
110 + } else {
111 + log.warn("LinkDiscovery stopped multiple times?");
112 + }
109 } 113 }
110 114
111 synchronized void start() { 115 synchronized void start() {
......