mirror of
https://github.com/faucetsdn/ryu.git
synced 2025-08-07 07:07:15 +02:00
doc: Consider null buffer_id in first example
If the switch does not buffer the packet (like when using mininet), the example does not work. For such cases, include the packet contents in OFPPacketOut
This commit is contained in:
parent
861587c8ed
commit
20c0ececeb
@ -67,11 +67,16 @@ the ports.
|
||||
dp = msg.datapath
|
||||
ofp = dp.ofproto
|
||||
ofp_parser = dp.ofproto_parser
|
||||
|
||||
|
||||
actions = [ofp_parser.OFPActionOutput(ofp.OFPP_FLOOD)]
|
||||
|
||||
data = None
|
||||
if msg.buffer_id == ofp.OFP_NO_BUFFER
|
||||
data = msg.data
|
||||
|
||||
out = ofp_parser.OFPPacketOut(
|
||||
datapath=dp, buffer_id=msg.buffer_id, in_port=msg.in_port,
|
||||
actions=actions)
|
||||
actions=actions, data = data)
|
||||
dp.send_msg(out)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user