From 2f4d4e0faf45a048c3c6ceae579a866485172a80 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 20 Jun 2012 07:35:23 +0900 Subject: 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 Reviewed-by: Simon Horman --- ryu/ofproto/nx_match.py | 8 +++----- 1 file 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: -- cgit v1.2.3