aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/devices/af_packet/device.c')
-rw-r--r--src/vnet/devices/af_packet/device.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/vnet/devices/af_packet/device.c b/src/vnet/devices/af_packet/device.c
index 2e9b7a4ed83..17291f76b71 100644
--- a/src/vnet/devices/af_packet/device.c
+++ b/src/vnet/devices/af_packet/device.c
@@ -291,8 +291,7 @@ static_always_inline void
fill_gso_offload (vlib_buffer_t *b0, vnet_virtio_net_hdr_t *vnet_hdr)
{
vnet_buffer_oflags_t oflags = vnet_buffer (b0)->oflags;
- i16 l4_hdr_offset =
- vnet_buffer (b0)->l4_hdr_offset - vnet_buffer (b0)->l2_hdr_offset;
+ i16 l4_hdr_offset = vnet_buffer (b0)->l4_hdr_offset - b0->current_data;
if (b0->flags & VNET_BUFFER_F_IS_IP4)
{
ip4_header_t *ip4;
@@ -329,8 +328,7 @@ static_always_inline void
fill_cksum_offload (vlib_buffer_t *b0, vnet_virtio_net_hdr_t *vnet_hdr)
{
vnet_buffer_oflags_t oflags = vnet_buffer (b0)->oflags;
- i16 l4_hdr_offset =
- vnet_buffer (b0)->l4_hdr_offset - vnet_buffer (b0)->l2_hdr_offset;
+ i16 l4_hdr_offset = vnet_buffer (b0)->l4_hdr_offset - b0->current_data;
if (b0->flags & VNET_BUFFER_F_IS_IP4)
{
ip4_header_t *ip4;