aboutgitcodebugslistschat
path: root/pcap.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-09-27 00:18:00 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-09-27 01:28:02 +0200
commite4b94da0af90e7ab707fd32d9e09e7bd767996df (patch)
treeae63f2c8c330b4e82d933ca2fc1710d7663532b2 /pcap.c
parent3943f20ef99d4146f0fa1a4025e2a62a3ad961f2 (diff)
downloadpasst-e4b94da0af90e7ab707fd32d9e09e7bd767996df.tar
passt-e4b94da0af90e7ab707fd32d9e09e7bd767996df.tar.gz
passt-e4b94da0af90e7ab707fd32d9e09e7bd767996df.tar.bz2
passt-e4b94da0af90e7ab707fd32d9e09e7bd767996df.tar.lz
passt-e4b94da0af90e7ab707fd32d9e09e7bd767996df.tar.xz
passt-e4b94da0af90e7ab707fd32d9e09e7bd767996df.tar.zst
passt-e4b94da0af90e7ab707fd32d9e09e7bd767996df.zip
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>
Diffstat (limited to 'pcap.c')
-rw-r--r--pcap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pcap.c b/pcap.c
index 43474da..1d7dd49 100644
--- a/pcap.c
+++ b/pcap.c
@@ -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;