From c2c8d4311bcd645b2874a38fefbcd509d1c01799 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Wed, 17 Jul 2013 11:39:55 +0900 Subject: [PATCH] of1.3: fix OFPort parser s/length/_length/ Trace: [0x1000082e5f694c00] ('143.0.1.211', 56538): OFPGetConfigReply received: flags=NORMAL miss_send_len=1518 Error in the datapath 1000082e5f694c00 from ('143.0.1.211', 56538) hub: uncaught exception: Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/ryu-2.1-py2.6.egg/ryu/lib/hub.py", line 48, in _launch func(*args, **kwargs) File "/usr/local/lib/python2.6/dist-packages/ryu-2.1-py2.6.egg/ryu/controller/controller.py", line 312, in datapath_connection_factory datapath.serve() File "/usr/local/lib/python2.6/dist-packages/ryu-2.1-py2.6.egg/ryu/controller/controller.py", line 232, in serve self._recv_loop() File "/usr/local/lib/python2.6/dist-packages/ryu-2.1-py2.6.egg/ryu/controller/controller.py", line 97, in deactivate method(self) File "/usr/local/lib/python2.6/dist-packages/ryu-2.1-py2.6.egg/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-2.1-py2.6.egg/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-2.1-py2.6.egg/ryu/ofproto/ofproto_v1_3_parser.py", line 50, in msg_parser return parser(datapath, version, msg_type, msg_len, xid, buf) File "/usr/local/lib/python2.6/dist-packages/ryu-2.1-py2.6.egg/ryu/ofproto/ofproto_v1_3_parser.py", line 2192, in parser offset += b._length AttributeError: 'OFPPort' object has no attribute '_length' Signed-off-by: FUJITA Tomonori --- ryu/ofproto/ofproto_v1_3_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ryu/ofproto/ofproto_v1_3_parser.py b/ryu/ofproto/ofproto_v1_3_parser.py index 223cd08c..79944694 100644 --- a/ryu/ofproto/ofproto_v1_3_parser.py +++ b/ryu/ofproto/ofproto_v1_3_parser.py @@ -1485,7 +1485,7 @@ class OFPPort(ofproto_parser.namedtuple('OFPPort', ( def parser(cls, buf, offset): port = struct.unpack_from(ofproto_v1_3.OFP_PORT_PACK_STR, buf, offset) ofpport = cls(*port) - ofpport.length = ofproto_v1_3.OFP_PORT_SIZE + ofpport._length = ofproto_v1_3.OFP_PORT_SIZE return ofpport