mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-05-05 04:16:11 +02:00
firewall: correct acquisition result of DENY rule
When blocked packet logging is enabled, GET rest command shows DENY rules as 'ALLOW' before. This patch improves it. Signed-off-by: WATANABE Fumitaka <watanabe.fumitaka1@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
7a10aafd39
commit
e67d9faf2b
@ -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}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user