fix the following crash reported by Adam Humphreys on ryu-devel.

Error in the datapath 0000399885270008 from ('127.0.0.1', 59999)
hub: uncaught exception: Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/ryu/lib/hub.py", line 48, in 
_launch
    func(*args, **kwargs)
  File "/usr/local/lib/python2.6/dist-packages/ryu/controller/controller.py", 
line 312, in datapath_connection_factory
    datapath.serve()
  File "/usr/local/lib/python2.6/dist-packages/ryu/controller/controller.py", 
line 232, in serve
    self._recv_loop()
  File "/usr/local/lib/python2.6/dist-packages/ryu/controller/controller.py", 
line 97, in deactivate                                                          
      method(self)                                                              
    File "/usr/local/lib/python2.6/dist-packages/ryu/controller/controller.py", 
line 165, in _recv_loop
    version, msg_type, msg_len, xid, buf)
  File "/usr/local/lib/python2.6/dist-packages/ryu/ofproto/ofproto_parser.py", 
line 54, in msg
    return msg_parser(datapath, version, msg_type, msg_len, xid, buf)           
  File 
"/usr/local/lib/python2.6/dist-packages/ryu/ofproto/ofproto_v1_3_parser.py", 
line 51, in msg_parser
    return parser(datapath, version, msg_type, msg_len, xid, buf)
  File 
"/usr/local/lib/python2.6/dist-packages/ryu/ofproto/ofproto_v1_3_parser.py", 
line 3384, in parser
    b = stats_type_cls.cls_stats_body_cls.parser(msg.buf, offset)
  File 
"/usr/local/lib/python2.6/dist-packages/ryu/ofproto/ofproto_v1_3_parser.py", 
line 3983, in parser
    stats.length = ofproto_v1_3.OFP_GROUP_STATS_SIZE
AttributeError: can't set attribute

Signed-off-by: YAMAMOTO Takashi <[email protected]>
---
 ryu/ofproto/ofproto_v1_3_parser.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ryu/ofproto/ofproto_v1_3_parser.py 
b/ryu/ofproto/ofproto_v1_3_parser.py
index b12865e..4d01489 100644
--- a/ryu/ofproto/ofproto_v1_3_parser.py
+++ b/ryu/ofproto/ofproto_v1_3_parser.py
@@ -3989,9 +3989,7 @@ class 
OFPGroupStats(ofproto_parser.namedtuple('OFPGroupStats', (
     def parser(cls, buf, offset):
         group = struct.unpack_from(ofproto_v1_3.OFP_GROUP_STATS_PACK_STR,
                                    buf, offset)
-        stats = cls(*group)
-        stats.length = ofproto_v1_3.OFP_GROUP_STATS_SIZE
-        return stats
+        return cls(*group)
 
 
 @_set_stats_type(ofproto_v1_3.OFPMP_GROUP, OFPGroupStats)
-- 
1.8.3.1


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135031&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to