virtio_net: stricter short buffer length checks
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 23 Oct 2014 21:22:11 +0000 (00:22 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 9 Dec 2014 10:05:28 +0000 (12:05 +0200)
commitbcff3162f3e0274a18648628ac8b5a36d2914b49
treeb04aa558e691fffe712355d8a8b63a0006377050
parent012873d057a449c4480e7679e733a7daa9aa540f
virtio_net: stricter short buffer length checks

Our buffer length check is not strict enough for mergeable
buffers: buffer can still be shorter that header + address
by 2 bytes.

Fix that up.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Jason Wang <jasowang@redhat.com>
drivers/net/virtio_net.c