Make ip csum configurable in vlib buffer functions
Also fixes csum computation for lisp control plane 4o6 encapsulated control
messages.
Change-Id: I991e0b5c0d16dc51e0b5bdc79e1d752270b34765
Signed-off-by: Florin Coras <fcoras@cisco.com>
diff --git a/src/vnet/ip/ip4.h b/src/vnet/ip/ip4.h
index 872b516..8f9a8e2 100644
--- a/src/vnet/ip/ip4.h
+++ b/src/vnet/ip/ip4.h
@@ -329,7 +329,8 @@
*/
always_inline void *
vlib_buffer_push_ip4 (vlib_main_t * vm, vlib_buffer_t * b,
- ip4_address_t * src, ip4_address_t * dst, int proto)
+ ip4_address_t * src, ip4_address_t * dst, int proto,
+ u8 csum_offload)
{
ip4_header_t *ih;
@@ -348,7 +349,7 @@
ih->dst_address.as_u32 = dst->as_u32;
/* Offload ip4 header checksum generation */
- if (1)
+ if (csum_offload)
{
ih->checksum = 0;
b->flags |= VNET_BUFFER_F_OFFLOAD_IP_CKSUM | VNET_BUFFER_F_IS_IP4;