ljerezchaves / ofswitch13

OFSwitch13: OpenFlow 1.3 module for ns-3.
http://www.lrc.ic.unicamp.br/ofswitch13/
GNU General Public License v2.0
24 stars 16 forks source link

actions set_field pack error #49

Closed DanielaSousa closed 1 year ago

DanielaSousa commented 1 year ago

When the controller sends a Packet_Out with a SetField Action, the buffer_id and other fields would be set to zero, when packing the packet to be sent. On further debugging, I found that the problem is on function ofl_msg_pack_packet_out line: 227 ( https://github.com/ljerezchaves/ofsoftswitch13/blob/625f01384522579db8f1c361209319530d53774a/sources/oflib/ofl-messages-pack.c#L227 ) the pointer to buf is never updated while packing an action, which overwrites the packet_out fields.

DanielaSousa commented 1 year ago

Solution: just replace buf with ptr variable

ptr += ofl_actions_pack(msg->actions[i], (struct ofp_action_header *)ptr, ptr , exp);
ljerezchaves commented 1 year ago

Fixed in 43ae19977817d7ecd113ae9603ffb713d5bed3c0