v2 mail had a strange indent again...
How is this patch ?
And attach patch file to make sure.

v2 -> v3
 attach patch file.



When blocked packet logging is enabled,
 GET rest command shows DENY rules as 'ALLOW' before.

This patch improves it.



Signed-off-by: WATANABE Fumitaka <[email protected]>
---
 ryu/app/rest_firewall.py |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ryu/app/rest_firewall.py b/ryu/app/rest_firewall.py
index 8b5a885..4710b0b 100644
--- a/ryu/app/rest_firewall.py
+++ b/ryu/app/rest_firewall.py
@@ -870,7 +870,7 @@ class Firewall(object):
         rule = {REST_RULE_ID: ruleid}
         rule.update({REST_PRIORITY: flow[REST_PRIORITY]})
         rule.update(Match.to_rest(flow))
-        rule.update(Action.to_rest(flow))
+        rule.update(Action.to_rest(self.dp, flow))
         return rule


@@ -988,9 +988,10 @@ class Action(object):
         return action

     @staticmethod
-    def to_rest(openflow):
+    def to_rest(dp, openflow):
         if REST_ACTION in openflow:
-            if len(openflow[REST_ACTION]) > 0:
+            action_allow = 'OUTPUT:%d' % dp.ofproto.OFPP_NORMAL
+            if openflow[REST_ACTION] == [action_allow]:
                 action = {REST_ACTION: REST_ACTION_ALLOW}
             else:
                 action = {REST_ACTION: REST_ACTION_DENY}
-- 
1.7.10.4
Signed-off-by: WATANABE Fumitaka <[email protected]>
---
 ryu/app/rest_firewall.py |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ryu/app/rest_firewall.py b/ryu/app/rest_firewall.py
index 8b5a885..4710b0b 100644
--- a/ryu/app/rest_firewall.py
+++ b/ryu/app/rest_firewall.py
@@ -870,7 +870,7 @@ class Firewall(object):
         rule = {REST_RULE_ID: ruleid}
         rule.update({REST_PRIORITY: flow[REST_PRIORITY]})
         rule.update(Match.to_rest(flow))
-        rule.update(Action.to_rest(flow))
+        rule.update(Action.to_rest(self.dp, flow))
         return rule
 
 
@@ -988,9 +988,10 @@ class Action(object):
         return action
 
     @staticmethod
-    def to_rest(openflow):
+    def to_rest(dp, openflow):
         if REST_ACTION in openflow:
-            if len(openflow[REST_ACTION]) > 0:
+            action_allow = 'OUTPUT:%d' % dp.ofproto.OFPP_NORMAL
+            if openflow[REST_ACTION] == [action_allow]:
                 action = {REST_ACTION: REST_ACTION_ALLOW}
             else:
                 action = {REST_ACTION: REST_ACTION_DENY}
-- 
1.7.10.4
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to