From: Willem de Bruijn <willemdebruijn.ker...@gmail.com> Date: Fri, 17 Nov 2017 17:59:13 -0500
> Tuntap and similar devices can inject GSO packets. Accept type > VIRTIO_NET_HDR_GSO_UDP, even though not generating UFO natively. > > Processes are expected to use feature negotiation such as TUNSETOFFLOAD > to detect supported offload types and refrain from injecting other > packets. This process breaks down with live migration: guest kernels > do not renegotiate flags, so destination hosts need to expose all > features that the source host does. > > Partially revert the UFO removal from 182e0b6b5846~1..d9d30adf5677. > This patch introduces nearly(*) no new code to simplify verification. > It brings back verbatim tuntap UFO negotiation, VIRTIO_NET_HDR_GSO_UDP > insertion and software UFO segmentation. This looks good, one minor nit: > @@ -2369,6 +2369,10 @@ static int set_offload(struct tun_struct *tun, > unsigned long arg) > features |= NETIF_F_TSO6; > arg &= ~(TUN_F_TSO4|TUN_F_TSO6); > } > + > + if (arg & TUN_F_UFO) { > + arg &= ~TUN_F_UFO; > + } This can be just simply "arg &= ~TUN_F_UFO;"? If anything the curly braces should be removed for a single statement basic block. Thanks for working so hard on fixing this.