Bug 4912 - NeutronL3Adapter: missing/reordered enabled check
authorIsaku Yamahata <isaku.yamahata@intel.com>
Sat, 9 Jan 2016 02:05:40 +0000 (18:05 -0800)
committerIsaku Yamahata <isaku.yamahata@intel.com>
Sat, 9 Jan 2016 05:48:22 +0000 (21:48 -0800)
NeutronL3Adapter.processEvent() can be called before its initialization
The security group process should be after enabled check.

Change-Id: I7fc48a70cacca5a9a1d7a017476259543c8a0086
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/NeutronL3Adapter.java

index 6869d10c6237bce85d80c3560b0013e419fcf47c..45920b18c61886ee94c7b28662279b579a6cfb8e 100644 (file)
@@ -190,6 +190,10 @@ public class NeutronL3Adapter extends AbstractHandler implements GatewayMacResol
             LOG.error("Unable to process abstract event " + abstractEvent);
             return;
         }
+        if (!this.enabled) {
+            return;
+        }
+
         NeutronL3AdapterEvent ev = (NeutronL3AdapterEvent) abstractEvent;
         switch (ev.getAction()) {
             case UPDATE:
@@ -421,10 +425,10 @@ public class NeutronL3Adapter extends AbstractHandler implements GatewayMacResol
     public void handleNeutronPortEvent(final NeutronPort neutronPort, Action action) {
         LOG.debug("Neutron port {} event : {}", action, neutronPort.toString());
 
-        this.processSecurityGroupUpdate(neutronPort);
         if (!this.enabled) {
             return;
         }
+        this.processSecurityGroupUpdate(neutronPort);
 
         final boolean isDelete = action == Action.DELETE;