]> git.proxmox.com Git - mirror_ovs.git/commit
ofproto-dpif-xlate: Correctly decide whether truncating.
authorBen Pfaff <blp@ovn.org>
Thu, 7 Dec 2017 23:54:03 +0000 (15:54 -0800)
committerBen Pfaff <blp@ovn.org>
Fri, 8 Dec 2017 23:15:31 +0000 (15:15 -0800)
commit8b496c72c782a1231806f6c9247730ebdc5a0a12
treecb8f280626d596752e7ff38ef00b601b05049638
parent391ce8049c767d22ff0f019cc809d6feeaaca2d8
ofproto-dpif-xlate: Correctly decide whether truncating.

xlate_output_action() must tell some of the functions it calls whether the
packet is being truncated.  Until now, it has inferred that based on
whether its max_len argument is nonzero.

Unfortunately, max_len conflates two different purposes.  Historically it
was used only to limit the number of bytes of packets sent to an OpenFlow
controller in packet_in messages.  When packet truncation was introduced,
it was then also used to specify the truncation length.  This meant that,
for example, when xlate_output_reg_action() called into
xlate_output_action() passing along for max_len an OpenFlow controller byte
limit (which ovs-ofctl by default sets to 65535), xlate_output_action()
interpreted that as a truncation request and told the functions it called
that the packet was being truncated, which in the worst case led to
assertion failures.

This commit disentangles these two meaning of max_len, separating them into
two separate parameters, and updates the callers.

Reported-by: Kevin Lin <kevin@kelda.io>
Reported-at: https://mail.openvswitch.org/pipermail/ovs-discuss/2017-December/045841.html
Tested-by: Kevin Lin <kevin@kelda.io>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ofproto/ofproto-dpif-xlate.c