summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vnet/interface_output.c5
-rw-r--r--src/vnet/interface_output.h3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c
index 2d220b7257b..7d058c20037 100644
--- a/src/vnet/interface_output.c
+++ b/src/vnet/interface_output.c
@@ -165,9 +165,8 @@ vnet_interface_output_trace (vlib_main_t * vm,
static_always_inline void
vnet_interface_output_handle_offload (vlib_main_t *vm, vlib_buffer_t *b)
{
- if (b->flags & VNET_BUFFER_F_OFFLOAD)
- vnet_calc_checksums_inline (vm, b, b->flags & VNET_BUFFER_F_IS_IP4,
- b->flags & VNET_BUFFER_F_IS_IP6);
+ vnet_calc_checksums_inline (vm, b, b->flags & VNET_BUFFER_F_IS_IP4,
+ b->flags & VNET_BUFFER_F_IS_IP6);
}
static_always_inline uword
diff --git a/src/vnet/interface_output.h b/src/vnet/interface_output.h
index 6b766d36c4f..bfd2066c2a8 100644
--- a/src/vnet/interface_output.h
+++ b/src/vnet/interface_output.h
@@ -87,6 +87,9 @@ vnet_calc_checksums_inline (vlib_main_t * vm, vlib_buffer_t * b,
udp_header_t *uh;
u32 oflags = vnet_buffer2 (b)->oflags;
+ if (!(b->flags & VNET_BUFFER_F_OFFLOAD))
+ return;
+
ASSERT (!(is_ip4 && is_ip6));
ip4 = (ip4_header_t *) (b->data + vnet_buffer (b)->l3_hdr_offset);