If using the virtio network channel, transferring packets between a host and a VM requires translating the packet's meta information between the fields in the virtio network header and, in the case of FreeBSD, the fields in the mbuf. On the VM side, this is done by the vtnet interface driver. On the host side, this is often done by the tap interface driver.
Both the vtnet driver and the tap driver, do the translation very similarly and in two ways less than good:
1. When sending a packet over the virtio network channel, they do not translate the `CSUM_DATA_VALID | CSUM_PSEUDO_HDR` mbuf flags in `VIRTIO_NET_HDR_F_DATA_VALID`.
2. When receiving a packet over the virtio network channel, they translate `VIRTIO_NET_HDR_F_NEEDS_CSUM` in the `CSUM_DATA_VALID | CSUM_PSEUDO_HDR` mbuf flags.
This patch adds for both drivers the translation 1. and changes the translation 2. of `VIRTIO_NET_HDR_F_NEEDS_CSUM` in the mbuf transmission checksum offload flag (`CSUM_TCP`, `CSUM_TCP_IPV6`, `CSUM_UDP`, or `CSUM_UDP_IPV6`).
Note that D51475 added the handling of an incoming packet with a transmission checksum offload flag set.