interface: use the correct condition for checking if the pcap fd is open
[vpp.git] / src / vnet / interface_output.c
index 1506db9..721236a 100644 (file)
@@ -1467,7 +1467,7 @@ pcap_drop_trace_command_fn (vlib_main_t * vm,
                  im->pcap_main.n_packets_to_capture =
                    im->pcap_main.n_packets_captured;
                  error = pcap_write (&im->pcap_main);
-                 if (im->pcap_main.file_descriptor >= 0)
+                 if (im->pcap_main.flags & PCAP_MAIN_INIT_DONE)
                    pcap_close (&im->pcap_main);
                  if (error)
                    clib_error_report (error);