Fix NPE in FlowProgrammerService in openflow plugin 20/2920/1
authorAlessandro Boch <aboch@cisco.com>
Wed, 20 Nov 2013 16:23:50 +0000 (08:23 -0800)
committerAlessandro Boch <aboch@cisco.com>
Wed, 20 Nov 2013 16:28:21 +0000 (08:28 -0800)
- In default container have installed flows matching on input port.
  When creating the first container, default container flows are removed.
  On switch notification about flow removal, a NPE is hit in FlowProgrammerService
  because of the assumption the newly created container already has ports assigned.

Change-Id: I645684f9bc47ea26d1fe9f45383343354fb3df6a
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/FlowProgrammerService.java

index b163c63..f26bcf7 100644 (file)
@@ -415,7 +415,7 @@ public class FlowProgrammerService implements IPluginInFlowProgrammerService,
              */
             if (inPort == null
                     || container.equals(GlobalConstants.DEFAULT.toString())
-                    || this.containerToNc.get(container).contains(inPort)) {
+                    || (containerToNc.containsKey(container) && containerToNc.get(container).contains(inPort))) {
                 notifier.flowRemoved(node, flow);
             }
         }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.