X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Finterface_output.c;h=49775d58d80bc9eab1bc6d7c2d9837b9be8cb3ce;hb=9534696b4637185c9f296375e63c50d8976d153d;hp=5e702e3b96c367bbdfed02b223102813f5ebb6e3;hpb=29467b5347dca90f4ef068ef8d34ffb97c2435f0;p=vpp.git diff --git a/src/vnet/interface_output.c b/src/vnet/interface_output.c index 5e702e3b96c..49775d58d80 100644 --- a/src/vnet/interface_output.c +++ b/src/vnet/interface_output.c @@ -503,7 +503,16 @@ static_always_inline void vnet_interface_pcap_tx_trace sw_if_index = vnet_buffer (b0)->sw_if_index[VLIB_TX]; if (pp->pcap_sw_if_index == 0 || pp->pcap_sw_if_index == sw_if_index) - pcap_add_buffer (&pp->pcap_main, vm, bi0, pp->max_bytes_per_pkt); + { + vnet_main_t *vnm = vnet_get_main (); + vnet_hw_interface_t *hi = + vnet_get_sup_hw_interface (vnm, sw_if_index); + /* Capture pkt if not filtered, or if filter hits */ + if (hi->trace_classify_table_index == ~0 || + vnet_is_packet_traced_inline + (b0, hi->trace_classify_table_index, 0 /* full classify */ )) + pcap_add_buffer (&pp->pcap_main, vm, bi0, pp->max_bytes_per_pkt); + } } }