OSDN Git Service

e1000e: Always copy ethernet header
authorAkihiko Odaki <akihiko.odaki@daynix.com>
Tue, 23 May 2023 02:42:59 +0000 (11:42 +0900)
committerJason Wang <jasowang@redhat.com>
Tue, 23 May 2023 07:20:15 +0000 (15:20 +0800)
commit310a128eae12339f97f6c940a7ddf92f40d283e4
treeda48032770d292e4f00f607f3a94ec283c39410b
parent2f0fa232b8c330df029120a6824c8be3d4eb5cae
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>
hw/net/e1000e_core.c