aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Luong <sluong@cisco.com>2020-10-12 12:27:25 -0700
committerSteven Luong <sluong@cisco.com>2020-10-12 12:27:25 -0700
commit2a335465793d77a703a844ddefb19067c1b127a0 (patch)
treedf3659aee366b8fc41a74b11bcb343d1ad7509ae
parent37e99c22df4ce5a87f5e56efbc2c0e836ed5b68f (diff)
virtio: fix the tcp/udp checksum offloads
Some vhost-backend calculates the wrong checksum in case of tcp/udp offload when driver resets tcp/udp checksum field to '0'. Type: fix Signed-off-by: Steven Luong <sluong@cisco.com> Change-Id: I3c45df487f00d7e3d949b4efb32d7f7e01d1108b
-rw-r--r--src/vnet/devices/virtio/vhost_user_input.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/vnet/devices/virtio/vhost_user_input.c b/src/vnet/devices/virtio/vhost_user_input.c
index 2cc192d9dc8..e2ad5cf7cae 100644
--- a/src/vnet/devices/virtio/vhost_user_input.c
+++ b/src/vnet/devices/virtio/vhost_user_input.c
@@ -296,15 +296,11 @@ vhost_user_handle_rx_offload (vlib_buffer_t * b0, u8 * b0_data,
tcp_header_t *tcp = (tcp_header_t *)
(b0_data + vnet_buffer (b0)->l4_hdr_offset);
l4_hdr_sz = tcp_header_bytes (tcp);
- tcp->checksum = 0;
b0->flags |= VNET_BUFFER_F_OFFLOAD_TCP_CKSUM;
}
else if (l4_proto == IP_PROTOCOL_UDP)
{
- udp_header_t *udp =
- (udp_header_t *) (b0_data + vnet_buffer (b0)->l4_hdr_offset);
- l4_hdr_sz = sizeof (*udp);
- udp->checksum = 0;
+ l4_hdr_sz = sizeof (udp_header_t);
b0->flags |= VNET_BUFFER_F_OFFLOAD_UDP_CKSUM;
}
}