summaryrefslogtreecommitdiffstats
path: root/src/vnet/pg/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/pg/cli.c')
-rw-r--r--src/vnet/pg/cli.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/vnet/pg/cli.c b/src/vnet/pg/cli.c
index c43ff903e75..f78bb37bf61 100644
--- a/src/vnet/pg/cli.c
+++ b/src/vnet/pg/cli.c
@@ -93,7 +93,10 @@ pg_capture (pg_capture_args_t * a)
pi = pool_elt_at_index (pg->interfaces, a->dev_instance);
vec_free (pi->pcap_file_name);
+ if ((pi->pcap_main.flags & PCAP_MAIN_INIT_DONE))
+ pcap_close (&pi->pcap_main);
clib_memset (&pi->pcap_main, 0, sizeof (pi->pcap_main));
+ pi->pcap_main.file_descriptor = -1;
if (a->is_enabled == 0)
return 0;