- 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 <[email protected]>
---
 ryu/ofproto/nx_match.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/ryu/ofproto/nx_match.py b/ryu/ofproto/nx_match.py
index 3100eba..a6f531f 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:
-- 
1.7.4.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to