diff --git a/ryu/lib/ofctl_v1_3.py b/ryu/lib/ofctl_v1_3.py index 37f67d08..7f67a710 100644 --- a/ryu/lib/ofctl_v1_3.py +++ b/ryu/lib/ofctl_v1_3.py @@ -238,7 +238,7 @@ def to_match(dp, attrs): match_append[key](ip, mask) elif key == 'tp_src' or key == 'tp_dst': # tp_src/dst - match = match_append[key](value, match, attrs) + match_append[key](value, match, attrs) elif key == 'metadata': # metadata metadata = value[0] diff --git a/ryu/ofproto/ofproto_v1_3.py b/ryu/ofproto/ofproto_v1_3.py index 95c03c70..e7a8593d 100644 --- a/ryu/ofproto/ofproto_v1_3.py +++ b/ryu/ofproto/ofproto_v1_3.py @@ -357,6 +357,9 @@ OFPFC_MODIFY_STRICT = 2 # Modify entry strictly matching wildcards OFPFC_DELETE = 3 # Delete all matching flows. OFPFC_DELETE_STRICT = 4 # Strictly match wildcards and priority. +# By default, choose a priority in the middle. +OFP_DEFAULT_PRIORITY = 0x8000 + # enum ofp_flow_mod_flags OFPFF_SEND_FLOW_REM = 1 << 0 # Send flow removed message when flow # expires or is deleted. diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py index 3d1c110e..78ad9fc0 100644 --- a/ryu/ofproto/ofproto_v1_3_parser.py +++ b/ryu/ofproto/ofproto_v1_3_parser.py @@ -2359,7 +2359,8 @@ class OFPFlowMod(MsgBase): """ def __init__(self, datapath, cookie=0, cookie_mask=0, table_id=0, command=ofproto_v1_3.OFPFC_ADD, - idle_timeout=0, hard_timeout=0, priority=0, + idle_timeout=0, hard_timeout=0, + priority=ofproto_v1_3.OFP_DEFAULT_PRIORITY, buffer_id=ofproto_v1_3.OFP_NO_BUFFER, out_port=0, out_group=0, flags=0, match=None,