diff options
author | Yuichi Ito <ito.yuichi0@gmail.com> | 2014-04-15 14:52:58 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2014-04-15 14:54:13 +0900 |
commit | bff600848874ac60041c4ad91e80bb61241cf723 (patch) | |
tree | 3b00c9a2ace66f3f569ecdb8a366ba765e2ad87b | |
parent | 02cce181083fa8d72e5990eda16c0f0567de8983 (diff) |
sw test tool: Fix to compare OFPMatch ignoring fields that masks are all zero bits
OF 1.3.3 spec (7.2.3.5 Flow Match Field Masking) says:
An all-zero-bits oxm_mask is equivalent to omitting the OXM TLV entirely. An all-one-bits oxm_mask
is equivalent to specifying 0 for oxm_hasmask and omitting oxm_mask.
This patch fixes to compare OFPMatch ignoring fields that masks are all zero bits.
Signed-off-by: Yuichi Ito <ito.yuichi0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/tests/switch/tester.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ryu/tests/switch/tester.py b/ryu/tests/switch/tester.py index dd05050b..4b12e291 100644 --- a/ryu/tests/switch/tester.py +++ b/ryu/tests/switch/tester.py @@ -793,8 +793,12 @@ class OfTester(app_manager.RyuApp): # when mask is all one bits, remove mask if mbytes == '\xff' * ofb.type.size: united_value = value + # when mask is all zero bits, remove field. + elif mbytes == '\x00' * ofb.type.size: + united_value = None break - match_fields.append((key, united_value)) + if united_value is not None: + match_fields.append((key, united_value)) return match_fields attr_list = ['cookie', 'priority', 'hard_timeout', 'idle_timeout', |