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.yusu...@gmail.com>
---
 ryu/controller/controller.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ryu/controller/controller.py b/ryu/controller/controller.py
index 10d8b45..b13ba88 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)
-- 
1.9.1


------------------------------------------------------------------------------
Go from Idea to Many App Stores Faster with Intel(R) XDK
Give your users amazing mobile app experiences with Intel(R) XDK.
Use one codebase in this all-in-one HTML5 development environment.
Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs.
http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
_______________________________________________
Ryu-devel mailing list
Ryu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to