]> git.ipfire.org Git - thirdparty/qemu.git/commit
e1000e: Always copy ethernet header
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Tue, 23 May 2023 02:42:59 +0000 (11:42 +0900)
committerMichael Tokarev <mjt@tls.msk.ru>
Wed, 24 May 2023 13:35:30 +0000 (16:35 +0300)
commitc84bcff3d3877658adf0bca3d8087488ecf0f3d9
treebeaa40c4619959546f47aa71395c6cc5926897a8
parent5c4f2f1b60e7d95ccc16262c3040d4c5f2f62126
e1000e: Always copy ethernet header

e1000e_receive_internal() used to check the iov length to determine
copy the iovs to a contiguous buffer, but the check is flawed in two
ways:
- It does not ensure that iovcnt > 0.
- It does not take virtio-net header into consideration.

The size of this copy is just 18 octets, which can be even less than
the code size required for checks. This (wrong) optimization is probably
not worth so just remove it.

Fixes: 6f3fbe4ed0 ("net: Introduce e1000e device emulation")
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit 310a128eae12339f97f6c940a7ddf92f40d283e4)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
hw/net/e1000e_core.c