]> git.ipfire.org Git - thirdparty/qemu.git/commit
net/tap: drop too small packets
authorVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Wed, 16 Jul 2025 07:28:53 +0000 (10:28 +0300)
committerJason Wang <jasowang@redhat.com>
Mon, 21 Jul 2025 02:21:28 +0000 (10:21 +0800)
commit3f9f6299a1bc46ff462142c7398a5953e3640cc2
tree6350f1f82fa890114bf7860b5d6f9db00194a8d3
parente82989544e38062beeeaad88c175afbeed0400f8
net/tap: drop too small packets

Theoretically tap_read_packet() may return size less than
s->host_vnet_hdr_len, and next, we'll work with negative size
(in case of !s->using_vnet_hdr). Let's avoid it.

Don't proceed with size == s->host_vnet_hdr_len as well in case
of !s->using_vnet_hdr, it doesn't make sense.

Tested-by: Lei Yang <leiyang@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Jason Wang <jasowang@redhat.com>
net/tap.c