diff options
author | Aloys Augustin <aloaugus@cisco.com> | 2021-04-15 18:12:51 +0200 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2021-04-19 17:32:05 +0000 |
commit | ac6c528fb22d427d7beacd73c247ffd97389dbfe (patch) | |
tree | 803ad12c9735b715deee9e9a69a77e4ecadec330 /src/vnet/interface_output.h | |
parent | 8932e450224fccdd8dad8992eb90bfead0ae7a7d (diff) |
ip: fix offload flags handling
The per-protocol offload flags only make sense if F_OFFLOAD is set on
the vlib buffer main flags.
vnet_calc_checksums_inline is called from many places which should do
this check and don't, moving the check to this function is less error
prone and shouldn't have an impact on performance since the function
is always_inline.
Type: fix
Change-Id: I0297f109f31e409f07bfbaea3cd8b90c659658c4
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
Diffstat (limited to 'src/vnet/interface_output.h')
-rw-r--r-- | src/vnet/interface_output.h | 3 |
1 files changed, 3 insertions, 0 deletions
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); |