From 5021716be31fcdac44bdacb0fa785416227ac394 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Sat, 1 Nov 2014 05:22:39 +0100 Subject: [PATCH] simple_switch: handle non-buffering switch Signed-off-by: FUJITA Tomonori --- ryu/app/simple_switch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ryu/app/simple_switch.py b/ryu/app/simple_switch.py index ffa8009fd..8fd3d2199 100644 --- a/ryu/app/simple_switch.py +++ b/ryu/app/simple_switch.py @@ -82,9 +82,13 @@ def _packet_in_handler(self, ev): if out_port != ofproto.OFPP_FLOOD: self.add_flow(datapath, msg.in_port, dst, actions) + data = None + if msg.buffer_id == ofproto.OFP_NO_BUFFER: + data = msg.data + out = datapath.ofproto_parser.OFPPacketOut( datapath=datapath, buffer_id=msg.buffer_id, in_port=msg.in_port, - actions=actions) + actions=actions, data=data) datapath.send_msg(out) @set_ev_cls(ofp_event.EventOFPPortStatus, MAIN_DISPATCHER)