summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-06-20 07:35:23 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2012-06-20 11:10:24 +0900
commit2f4d4e0faf45a048c3c6ceae579a866485172a80 (patch)
tree65a5b2607a0cbd1a29a3677e19db387fafc7980b
parenta3469e399c38bd298ef6a14b25a81e2384c04bd7 (diff)
nxm: fix NXM_OF_ICMP_TYPE and NXM_OF_ICMP_CODE
- Set the proper values for both - NXM_OF_ICMP_TYPE and NXM_OF_ICMP_CODE should be set at the same time. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Reviewed-by: Simon Horman <horms@verge.net.au>
-rw-r--r--ryu/ofproto/nx_match.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/ryu/ofproto/nx_match.py b/ryu/ofproto/nx_match.py
index 3100eba9..a6f531f7 100644
--- a/ryu/ofproto/nx_match.py
+++ b/ryu/ofproto/nx_match.py
@@ -473,7 +473,7 @@ class MFICMPType(MFField):
return cls(MF_PACK_STRING_8)
def put(self, buf, offset, rule):
- return self._put(buf, offset, rule.flow.nw_src)
+ return self._put(buf, offset, rule.flow.tp_src)
@_register_make
@@ -484,7 +484,7 @@ class MFICMPCode(MFField):
return cls(MF_PACK_STRING_8)
def put(self, buf, offset, rule):
- return self._put(buf, offset, rule.flow.nw_dst)
+ return self._put(buf, offset, rule.flow.tp_dst)
def serialize_nxm_match(rule, buf, offset):
@@ -533,10 +533,8 @@ def serialize_nxm_match(rule, buf, offset):
== IPPROTO_ICMP):
if rule.wc.tp_src_mask != 0:
offset += nxm_put(buf, offset, ofproto_v1_0.NXM_OF_ICMP_TYPE, rule)
- elif rule.wc.tp_dst_mask != 0:
+ if rule.wc.tp_dst_mask != 0:
offset += nxm_put(buf, offset, ofproto_v1_0.NXM_OF_ICMP_CODE, rule)
- else:
- pass
if rule.flow.tp_src != 0:
if rule.flow.nw_proto == 6: