From a84e3c483f492477ace9f6da6908754cb257c225 Mon Sep 17 00:00:00 2001 From: Alessandro Boch Date: Mon, 1 Jul 2013 16:40:15 -0700 Subject: [PATCH] When containers are present, static flows add/removal/toggling should be blocked on default container - In FRM have the static flow APIs call the [install/uninstall/modify]FlowEntry() API instead of the lower level [add/remove/modify]Entry() functions which do not perform the container mode check Change-Id: I8da638fcc36726f8f2dfe0b6733b49614329c7ab Signed-off-by: Alessandro Boch --- .../internal/ForwardingRulesManagerImpl.java | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java index d4588d620b..2c5144f284 100644 --- a/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java +++ b/opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerImpl.java @@ -1444,7 +1444,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, Port } // Program the network node - Status status = this.removeEntry(config.getFlowEntry(), false); + Status status = this.uninstallFlowEntry(config.getFlowEntry()); // Update configuration database if programming was successful if (status.isSuccess()) { @@ -1543,7 +1543,7 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, Port // If flow is installed, program the network node status = new Status(StatusCode.SUCCESS, "Saved in config"); if (oldFlowConfig.installInHw()) { - status = this.modifyEntry(oldFlowConfig.getFlowEntry(), newFlowConfig.getFlowEntry(), false); + status = this.modifyFlowEntry(oldFlowConfig.getFlowEntry(), newFlowConfig.getFlowEntry()); } // Update configuration database if programming was successful @@ -1588,16 +1588,14 @@ public class ForwardingRulesManagerImpl implements IForwardingRulesManager, Port } if (target != null) { // Program the network node - Status status; - if (target.installInHw()) { - status = this.removeEntry(target.getFlowEntry(), false); - } else { - status = this.addEntry(target.getFlowEntry(), false); + Status status = (target.installInHw()) ? this.uninstallFlowEntry(target.getFlowEntry()) : this + .installFlowEntry(target.getFlowEntry()); + if (status.isSuccess()) { + // Update Configuration database + target.setStatus(SUCCESS); + target.toggleInstallation(); + staticFlows.put(key, target); } - // Update Configuration database - target.setStatus(SUCCESS); - target.toggleInstallation(); - staticFlows.put(key, target); return status; } -- 2.36.6