aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/virtio/vhost_user_output.c
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2020-03-25 20:37:16 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2020-03-30 11:39:22 +0000
commit0937fdfa86ce61c54f37d142aabae45463a959e5 (patch)
tree2aacbc36145319c9fac0ffe7dafd8d74b7e43b2b /src/vnet/devices/virtio/vhost_user_output.c
parent7654a718669f0dc950344c049186b9452bf48ca9 (diff)
gso: fix the header parser to read only
Previously, header parser sets the tcp/udp checksum to 0. It should be read only function for vlib_buffer_t. Type: fix Change-Id: I9c3398372f22998da3df188f0b7db13748303068 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/vhost_user_output.c')
-rw-r--r--src/vnet/devices/virtio/vhost_user_output.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_output.c b/src/vnet/devices/virtio/vhost_user_output.c
index c1b8fe1a92a..e1f42ce1559 100644
--- a/src/vnet/devices/virtio/vhost_user_output.c
+++ b/src/vnet/devices/virtio/vhost_user_output.c
@@ -253,12 +253,18 @@ vhost_user_handle_tx_offload (vhost_user_intf_t * vui, vlib_buffer_t * b,
hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
hdr->csum_start = gho.l4_hdr_offset;
hdr->csum_offset = offsetof (udp_header_t, checksum);
+ udp_header_t *udp =
+ (udp_header_t *) (vlib_buffer_get_current (b) + gho.l4_hdr_offset);
+ udp->checksum = 0;
}
else if (b->flags & VNET_BUFFER_F_OFFLOAD_TCP_CKSUM)
{
hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
hdr->csum_start = gho.l4_hdr_offset;
hdr->csum_offset = offsetof (tcp_header_t, checksum);
+ tcp_header_t *tcp =
+ (tcp_header_t *) (vlib_buffer_get_current (b) + gho.l4_hdr_offset);
+ tcp->checksum = 0;
}
/* GSO offload */