mirror of
https://github.com/faucetsdn/ryu.git
synced 2026-01-23 01:21:31 +01:00
rest_firewall: Prevent adding fields which is unrelated to match
This patch prevent rest_firewall.py from adding unrelated fields (e.g. priority, actions) into match fields. Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
parent
45762b0d9e
commit
e598af67d2
@ -897,6 +897,19 @@ class Match(object):
|
||||
REST_NW_PROTO_ICMP: inet.IPPROTO_ICMP,
|
||||
REST_NW_PROTO_ICMPV6: inet.IPPROTO_ICMPV6}}
|
||||
|
||||
_MATCHES = [REST_IN_PORT,
|
||||
REST_SRC_MAC,
|
||||
REST_DST_MAC,
|
||||
REST_DL_TYPE,
|
||||
REST_DL_VLAN,
|
||||
REST_SRC_IP,
|
||||
REST_DST_IP,
|
||||
REST_SRC_IPV6,
|
||||
REST_DST_IPV6,
|
||||
REST_NW_PROTO,
|
||||
REST_TP_SRC,
|
||||
REST_TP_DST]
|
||||
|
||||
@staticmethod
|
||||
def to_openflow(rest):
|
||||
|
||||
@ -1002,7 +1015,7 @@ class Match(object):
|
||||
match.setdefault(key, Match._CONVERT[key][value])
|
||||
else:
|
||||
raise ValueError('Invalid rule parameter. : key=%s' % key)
|
||||
else:
|
||||
elif key in Match._MATCHES:
|
||||
match.setdefault(key, value)
|
||||
|
||||
return match
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user