Re: [PATCH 2/2] hw/net/rtl8139: Send whole of vlan-tagged packet when doing loopback

Bin Meng <[email protected]> Sat, 1 Aug 2026 00:45:20 +0800
Newsgroups org.nongnu.qemu-devel
Message-ID <CAEUhbmWx8mdX5xJ=O4620onXk4-HoOR=jULVcfYfRom-SF+dow@mail.gmail.com>
On Fri, Jul 31, 2026 at 5:36 PM Peter Maydell <[email protected]> wrote:
>
> In rtl8139_transfer_frame(), if we are transmitting a frame over
> loopback then we do this by calling qemu_receive_packet().  If we
> have an iovec rather than a simple buffer (which happens only when
> we're sending a packet where we are inserting a vlan tag), we have to
> convert this into a simple buffer first using iov_to_buf().  However,
> when we do this we forget to also update the 'size' local variable to
> the size of the new simple buffer, so we will truncate the packet by
> 4 bytes (the size of the vlan tag).
>
> Correct the logic so we don't truncate vlan-tagged packets when
> sending them over loopback.
>
> Cc: [email protected]
> Reported-by: Bin Meng <[email protected]>
> Signed-off-by: Peter Maydell <[email protected]>
> ---
>  hw/net/rtl8139.c | 1 +
>  1 file changed, 1 insertion(+)
>

Reviewed-by: Bin Meng <[email protected]>