mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-09 08:17:53 -06:00
slirp: Cleanup resources on instance removal
Close & free sockets when shutting down a slirp instance, also release all buffers. CC: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
f373431977
commit
a68adc2206
10 changed files with 58 additions and 0 deletions
|
@ -55,6 +55,13 @@ tcp_init(Slirp *slirp)
|
|||
slirp->tcp_last_so = &slirp->tcb;
|
||||
}
|
||||
|
||||
void tcp_cleanup(Slirp *slirp)
|
||||
{
|
||||
while (slirp->tcb.so_next != &slirp->tcb) {
|
||||
tcp_close(sototcpcb(slirp->tcb.so_next));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Create template to be used to send tcp packets on a connection.
|
||||
* Call after host entry created, fills
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue