vnet_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
vnet_hdr->csum_start = vnet_buffer (b0)->l4_hdr_offset; // 0x22;
vnet_hdr->csum_offset = STRUCT_OFFSET_OF (tcp_header_t, checksum);
- ip4 = (ip4_header_t *) (vlib_buffer_get_current (b0) +
- vnet_buffer (b0)->l3_hdr_offset);
+ ip4 = (ip4_header_t *) (b0->data + vnet_buffer (b0)->l3_hdr_offset);
if (oflags & VNET_BUFFER_OFFLOAD_F_IP_CKSUM)
ip4->checksum = ip4_header_checksum (ip4);
}
if (b0->flags & VNET_BUFFER_F_IS_IP4)
{
ip4_header_t *ip4;
- ip4 = (ip4_header_t *) (vlib_buffer_get_current (b0) +
- vnet_buffer (b0)->l3_hdr_offset);
+ ip4 = (ip4_header_t *) (b0->data + vnet_buffer (b0)->l3_hdr_offset);
if (oflags & VNET_BUFFER_OFFLOAD_F_IP_CKSUM)
ip4->checksum = ip4_header_checksum (ip4);
vnet_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
if (oflags & VNET_BUFFER_OFFLOAD_F_TCP_CKSUM)
{
tcp_header_t *tcp =
- (tcp_header_t *) (vlib_buffer_get_current (b0) +
- vnet_buffer (b0)->l4_hdr_offset);
+ (tcp_header_t *) (b0->data + vnet_buffer (b0)->l4_hdr_offset);
tcp->checksum = ip4_pseudo_header_cksum (ip4);
vnet_hdr->csum_offset = STRUCT_OFFSET_OF (tcp_header_t, checksum);
}
else if (oflags & VNET_BUFFER_OFFLOAD_F_UDP_CKSUM)
{
udp_header_t *udp =
- (udp_header_t *) (vlib_buffer_get_current (b0) +
- vnet_buffer (b0)->l4_hdr_offset);
+ (udp_header_t *) (b0->data + vnet_buffer (b0)->l4_hdr_offset);
udp->checksum = ip4_pseudo_header_cksum (ip4);
vnet_hdr->csum_offset = STRUCT_OFFSET_OF (udp_header_t, checksum);
}
ip6_header_t *ip6;
vnet_hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM;
vnet_hdr->csum_start = 0x36;
- ip6 = (ip6_header_t *) (vlib_buffer_get_current (b0) +
- vnet_buffer (b0)->l3_hdr_offset);
+ ip6 = (ip6_header_t *) (b0->data + vnet_buffer (b0)->l3_hdr_offset);
if (oflags & VNET_BUFFER_OFFLOAD_F_TCP_CKSUM)
{
tcp_header_t *tcp =
- (tcp_header_t *) (vlib_buffer_get_current (b0) +
- vnet_buffer (b0)->l4_hdr_offset);
+ (tcp_header_t *) (b0->data + vnet_buffer (b0)->l4_hdr_offset);
tcp->checksum = ip6_pseudo_header_cksum (ip6);
vnet_hdr->csum_offset = STRUCT_OFFSET_OF (tcp_header_t, checksum);
}
else if (oflags & VNET_BUFFER_OFFLOAD_F_UDP_CKSUM)
{
udp_header_t *udp =
- (udp_header_t *) (vlib_buffer_get_current (b0) +
- vnet_buffer (b0)->l4_hdr_offset);
+ (udp_header_t *) (b0->data + vnet_buffer (b0)->l4_hdr_offset);
udp->checksum = ip6_pseudo_header_cksum (ip6);
vnet_hdr->csum_offset = STRUCT_OFFSET_OF (udp_header_t, checksum);
}