qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] net: use peer when purging queue in qemu_flush_or_purge_queue_pa


From: Jason Wang
Subject: [PATCH] net: use peer when purging queue in qemu_flush_or_purge_queue_packets()
Date: Mon, 11 May 2020 12:04:53 +0800

The sender of packet will be checked in the qemu_net_queue_purge() but
we use NetClientState not its peer when trying to purge the incoming
queue in qemu_flush_or_purge_packets(). This will trigger the assert
in virtio_net_reset since we can't pass the sender check.

Fix by using the peer.

Reported-by: "Alexander Bulekov" <address@hidden>
Fixes: ca77d85e1dbf9 ("net: complete all queued packets on VM stop")
Cc: address@hidden
Signed-off-by: Jason Wang <address@hidden>
---
 net/net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index 38778e831d..9e47cf727d 100644
--- a/net/net.c
+++ b/net/net.c
@@ -610,7 +610,7 @@ void qemu_flush_or_purge_queued_packets(NetClientState *nc, 
bool purge)
         qemu_notify_event();
     } else if (purge) {
         /* Unable to empty the queue, purge remaining packets */
-        qemu_net_queue_purge(nc->incoming_queue, nc);
+        qemu_net_queue_purge(nc->incoming_queue, nc->peer);
     }
 }
 
-- 
2.20.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]