ih->src_address.as_u32 = src->as_u32;
ih->dst_address.as_u32 = dst->as_u32;
+ vnet_buffer (b)->l3_hdr_offset = (u8 *) ih - b->data;
+ b->flags |= VNET_BUFFER_F_IS_IP4 | VNET_BUFFER_F_L3_HDR_OFFSET_VALID;
+
/* Offload ip4 header checksum generation */
if (csum_offload)
{
ih->checksum = 0;
- b->flags |= VNET_BUFFER_F_OFFLOAD_IP_CKSUM | VNET_BUFFER_F_IS_IP4;
- vnet_buffer (b)->l3_hdr_offset = (u8 *) ih - b->data;
- vnet_buffer (b)->l4_hdr_offset = vnet_buffer (b)->l3_hdr_offset +
- sizeof (*ih);
- b->flags |=
- VNET_BUFFER_F_L3_HDR_OFFSET_VALID | VNET_BUFFER_F_L4_HDR_OFFSET_VALID;
+ b->flags |= VNET_BUFFER_F_OFFLOAD_IP_CKSUM;
}
else
ih->checksum = ip4_header_checksum (ih);