pcap: Don't reinitialise packet capture if we already have one

If the guest disconnects, and a given name (without timestamp) for
the pcap file is passed, we would otherwise lose the packets
captured until that point.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
Stefano Brivio 2021-09-27 00:18:00 +02:00
parent 3943f20ef9
commit e4b94da0af

2
pcap.c
View file

@ -162,7 +162,7 @@ void pcap_init(struct ctx *c, int index)
struct tm *tm;
if (pcap_fd != -1)
close(pcap_fd);
return;
if (!*c->pcap)
return;