summary refs log tree commit diff stats
path: root/hw/misc/ivshmem-flat.c
diff options
context:
space:
mode:
authorLaurent Vivier <lvivier@redhat.com>2025-01-17 12:17:08 +0100
committerMichael Tokarev <mjt@tls.msk.ru>2025-01-30 12:50:07 +0300
commit84dfdcbff33fff185528501be408c25c44499f32 (patch)
tree0353c8be83a6c05b4292508382de6bf1d7e552c5 /hw/misc/ivshmem-flat.c
parent871af84dd599fab68c8ed414d9ecbdb2bcfc5801 (diff)
downloadfocaccia-qemu-84dfdcbff33fff185528501be408c25c44499f32.tar.gz
focaccia-qemu-84dfdcbff33fff185528501be408c25c44499f32.zip
net: Fix announce_self
b9ad513e1876 ("net: Remove receive_raw()") adds an iovec entry
in qemu_deliver_packet_iov() to add the virtio-net header
in the data when QEMU_NET_PACKET_FLAG_RAW is set but forgets
to increase the number of iovec entries in the array, so
receive_iov() will only send the first entry (the virtio-net
entry, full of 0) and no data. The packet will be discarded.

The only user of QEMU_NET_PACKET_FLAG_RAW is announce_self.

We can see the problem with tcpdump:

- QEMU parameters:

  .. -monitor stdio \
     -netdev bridge,id=netdev0,br=virbr0 \
     -device virtio-net,mac=9a:2b:2c:2d:2e:2f,netdev=netdev0 \

- HMP command:

  (qemu) announce_self

- TCP dump:

  $ sudo tcpdump -nxi virbr0

  without the fix:

    <nothing>

  with the fix:

   ARP, Reverse Request who-is 9a:2b:2c:2d:2e:2f tell 9a:2b:2c:2d:2e:2f, length 46
        0x0000:  0001 0800 0604 0003 9a2b 2c2d 2e2f 0000
        0x0010:  0000 9a2b 2c2d 2e2f 0000 0000 0000 0000
        0x0020:  0000 0000 0000 0000 0000 0000 0000

Reported-by: Xiaohui Li <xiaohli@redhat.com>
Bug: https://issues.redhat.com/browse/RHEL-73891
Fixes: b9ad513e1876 ("net: Remove receive_raw()")
Cc: akihiko.odaki@daynix.com
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/misc/ivshmem-flat.c')
0 files changed, 0 insertions, 0 deletions