aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2023-01-18 19:34:00 +0000
committerMohsin Kazmi <sykazmi@cisco.com>2023-01-18 19:34:00 +0000
commit8a0fd0669047c90d410d2ed5cb508bfe778b932a (patch)
treee9276b6842853d2810d61a7f9450208caad0b19d /src/plugins
parent2ebb95228f15c3e248f51aa2ce0e08914a70e495 (diff)
af_packet: add the missing header-len for packets with checksum offload
Type: fix Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com> Change-Id: Ifb790c25b38b2b1865cda7d95891bddd4195c601
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/af_packet/device.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/af_packet/device.c b/src/plugins/af_packet/device.c
index b38d58cced1..27f5559c8cd 100644
--- a/src/plugins/af_packet/device.c
+++ b/src/plugins/af_packet/device.c
@@ -343,6 +343,7 @@ fill_cksum_offload (vlib_buffer_t *b0, vnet_virtio_net_hdr_t *vnet_hdr)
(tcp_header_t *) (b0->data + vnet_buffer (b0)->l4_hdr_offset);
tcp->checksum = ip4_pseudo_header_cksum (ip4);
vnet_hdr->csum_offset = STRUCT_OFFSET_OF (tcp_header_t, checksum);
+ vnet_hdr->hdr_len = l4_hdr_offset + tcp_header_bytes (tcp);
}
else if (oflags & VNET_BUFFER_OFFLOAD_F_UDP_CKSUM)
{
@@ -350,6 +351,7 @@ fill_cksum_offload (vlib_buffer_t *b0, vnet_virtio_net_hdr_t *vnet_hdr)
(udp_header_t *) (b0->data + vnet_buffer (b0)->l4_hdr_offset);
udp->checksum = ip4_pseudo_header_cksum (ip4);
vnet_hdr->csum_offset = STRUCT_OFFSET_OF (udp_header_t, checksum);
+ vnet_hdr->hdr_len = l4_hdr_offset + sizeof (udp_header_t);
}
}
else if (b0->flags & VNET_BUFFER_F_IS_IP6)
@@ -364,6 +366,7 @@ fill_cksum_offload (vlib_buffer_t *b0, vnet_virtio_net_hdr_t *vnet_hdr)
(tcp_header_t *) (b0->data + vnet_buffer (b0)->l4_hdr_offset);
tcp->checksum = ip6_pseudo_header_cksum (ip6);
vnet_hdr->csum_offset = STRUCT_OFFSET_OF (tcp_header_t, checksum);
+ vnet_hdr->hdr_len = l4_hdr_offset + tcp_header_bytes (tcp);
}
else if (oflags & VNET_BUFFER_OFFLOAD_F_UDP_CKSUM)
{
@@ -371,6 +374,7 @@ fill_cksum_offload (vlib_buffer_t *b0, vnet_virtio_net_hdr_t *vnet_hdr)
(udp_header_t *) (b0->data + vnet_buffer (b0)->l4_hdr_offset);
udp->checksum = ip6_pseudo_header_cksum (ip6);
vnet_hdr->csum_offset = STRUCT_OFFSET_OF (udp_header_t, checksum);
+ vnet_hdr->hdr_len = l4_hdr_offset + sizeof (udp_header_t);
}
}
}