From d99d0127cebd3dd91cc4e8f58f031660f276400a Mon Sep 17 00:00:00 2001 From: kjwon15 Date: Mon, 19 Jan 2015 20:37:24 +0900 Subject: [PATCH 1/2] Validate clear_actions {"clear_actions": false} should not be enable clear_actions feature. --- .../module/staticentrymanager/StaticFlowEntry.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Torpedo/src/etri/sdn/controller/module/staticentrymanager/StaticFlowEntry.java b/Torpedo/src/etri/sdn/controller/module/staticentrymanager/StaticFlowEntry.java index 6329dd5a..0c86222a 100644 --- a/Torpedo/src/etri/sdn/controller/module/staticentrymanager/StaticFlowEntry.java +++ b/Torpedo/src/etri/sdn/controller/module/staticentrymanager/StaticFlowEntry.java @@ -693,9 +693,12 @@ else if (inststr.toLowerCase().equals("apply_actions")) { instructions.add(inst); } else if (inststr.toLowerCase().equals("clear_actions")) { - OFInstructionClearActions inst = - fac.instructions().clearActions(); - instructions.add(inst); + String value = (String) entry.get("clear_actions"); + if (value.toLowerCase().equals("true")) { + OFInstructionClearActions inst = + fac.instructions().clearActions(); + instructions.add(inst); + } } else { throw new StaticFlowEntryException("Unexpected instruction " + inststr); From 07505d17616a655122d164241df4f81f11a47724 Mon Sep 17 00:00:00 2001 From: kjwon15 Date: Tue, 20 Jan 2015 09:59:55 +0900 Subject: [PATCH 2/2] Get clear_actions as boolean Conflicts: Torpedo/src/etri/sdn/controller/module/staticentrymanager/StaticFlowEntry.java --- .../module/staticentrymanager/StaticFlowEntry.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Torpedo/src/etri/sdn/controller/module/staticentrymanager/StaticFlowEntry.java b/Torpedo/src/etri/sdn/controller/module/staticentrymanager/StaticFlowEntry.java index 0c86222a..6c485f46 100644 --- a/Torpedo/src/etri/sdn/controller/module/staticentrymanager/StaticFlowEntry.java +++ b/Torpedo/src/etri/sdn/controller/module/staticentrymanager/StaticFlowEntry.java @@ -693,9 +693,9 @@ else if (inststr.toLowerCase().equals("apply_actions")) { instructions.add(inst); } else if (inststr.toLowerCase().equals("clear_actions")) { - String value = (String) entry.get("clear_actions"); - if (value.toLowerCase().equals("true")) { - OFInstructionClearActions inst = + boolean clearActions = (boolean) entry.get("clear_actions"); + if (clearActions) { + OFInstructionClearActions inst = fac.instructions().clearActions(); instructions.add(inst); }