Skip to content

Commit

Permalink
virtio-net: avoid leaking vqmsg when simulation ends
Browse files Browse the repository at this point in the history
  • Loading branch information
janweinstock authored and aut0 committed Oct 24, 2024
1 parent 4d05e03 commit 9f318e2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vcml/models/virtio/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ bool net::handle_tx(vq_message& msg) {

void net::rx_thread() {
while (true) {
vq_message msg;
while (!virtio_in->get(VIRTQUEUE_RX, msg))
wait(m_rxev);

eth_frame frame;
while (!eth_rx_pop(frame))
wait(m_rxev);

vq_message msg;
while (!virtio_in->get(VIRTQUEUE_RX, msg))
wait(m_rxev);

if (!handle_rx(msg, frame) || !virtio_in->put(VIRTQUEUE_RX, msg))
log_warn("packet reception failed");
}
Expand Down

0 comments on commit 9f318e2

Please sign in to comment.