diff options
author | IWASE Yusuke <iwase.yusuke0@gmail.com> | 2015-12-04 14:56:54 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2015-12-08 21:24:49 +0900 |
commit | 0a223481ddb4a3b0a936fdd9ff5f8168e974ce46 (patch) | |
tree | b579db1e5570ba00343981080806bbee5be32efd | |
parent | 6ca70939a4c3b19a421cdf648b74d3337c604e02 (diff) |
controller: Split received message buffer
When Ryu getting multiple OpenFlow messages in a single packet,
_recv_loop() can pass the messages data including the subsequent
OpenFlow message binary data to ofproto_parser.msg().
If the received OpenFlow message containing a binary data field
(e.g. Echo-Reply, Packet-In), the parser may compose messages
class with the subsequent messages data into the data field.
This patch splits the received message buffer by the recieved
OpenFlow message lenght and passes it to the parser.
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r-- | ryu/controller/controller.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py index 10d8b453..b13ba889 100644 --- a/ryu/controller/controller.py +++ b/ryu/controller/controller.py @@ -190,8 +190,8 @@ class Datapath(ofproto_protocol.ProtocolDesc): if len(buf) < required_len: break - msg = ofproto_parser.msg(self, - version, msg_type, msg_len, xid, buf) + msg = ofproto_parser.msg( + self, version, msg_type, msg_len, xid, buf[:msg_len]) # LOG.debug('queue msg %s cls %s', msg, msg.__class__) if msg: ev = ofp_event.ofp_msg_to_ev(msg) |