summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/interface_cli.c')
-rw-r--r--src/vnet/interface_cli.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vnet/interface_cli.c b/src/vnet/interface_cli.c
index 437854476b4..8db26391573 100644
--- a/src/vnet/interface_cli.c
+++ b/src/vnet/interface_cli.c
@@ -1743,6 +1743,8 @@ pcap_trace_command_internal (vlib_main_t * vm,
vm->pcap[rx_tx].pcap_main.n_packets_to_capture =
vm->pcap[rx_tx].pcap_main.n_packets_captured;
error = pcap_write (&vm->pcap[rx_tx].pcap_main);
+ if (vm->pcap[rx_tx].pcap_main.file_descriptor >= 0)
+ pcap_close (&vm->pcap[rx_tx].pcap_main);
if (error)
clib_error_report (error);
else