diff mbox series

[v5,3/3] net: tulip: flush queued packets post receive

Message ID 20200319174050.759794-4-ppandit@redhat.com (mailing list archive)
State New, archived
Headers show
Series net: tulip: add checks to avoid OOB access | expand

Commit Message

Prasad Pandit March 19, 2020, 5:40 p.m. UTC
From: Prasad J Pandit <pjp@fedoraproject.org>

Call qemu_flush_queued_packets to flush queued packets once they
are read in tulip_receive().

Suggested-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
---
 hw/net/tulip.c | 2 ++
 1 file changed, 2 insertions(+)

Update v4: call qemu_flush_queued_packets()
  -> https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg05868.html
diff mbox series

Patch

diff --git a/hw/net/tulip.c b/hw/net/tulip.c
index 757f12c710..8d8c9519e7 100644
--- a/hw/net/tulip.c
+++ b/hw/net/tulip.c
@@ -287,6 +287,8 @@  static ssize_t tulip_receive(TULIPState *s, const uint8_t *buf, size_t size)
         tulip_desc_write(s, s->current_rx_desc, &desc);
         tulip_next_rx_descriptor(s, &desc);
     } while (s->rx_frame_len);
+
+    qemu_flush_queued_packets(qemu_get_queue(s->nic));
     return size;
 }