From 30a819579cb396db1c975ae8e08477129aa7950d Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Fri, 26 Feb 2021 13:47:41 +0100 Subject: classify: honor pcap interface filter also when classify filter is used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Type: fix Change-Id: Ic32550ee9c5d76d232d8b67a7810611f6c8b9177 Signed-off-by: Benoît Ganne --- src/vnet/ethernet/node.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) (limited to 'src/vnet/ethernet/node.c') diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c index c31e22299b3..88b4a70a28a 100644 --- a/src/vnet/ethernet/node.c +++ b/src/vnet/ethernet/node.c @@ -44,7 +44,7 @@ #include #include #include -#include +#include #define foreach_ethernet_input_next \ _ (PUNT, "error-punt") \ @@ -1169,38 +1169,13 @@ ethernet_input_trace (vlib_main_t * vm, vlib_node_runtime_t * node, n_left = from_frame->n_vectors; while (n_left > 0) { - int classify_filter_result; vlib_buffer_t *b0; bi0 = from[0]; from++; n_left--; b0 = vlib_get_buffer (vm, bi0); - if (pp->filter_classify_table_index != ~0) - { - classify_filter_result = - vnet_is_packet_traced_inline - (b0, pp->filter_classify_table_index, 0 /* full classify */ ); - if (classify_filter_result) - pcap_add_buffer (&pp->pcap_main, vm, bi0, - pp->max_bytes_per_pkt); - continue; - } - - if (pp->pcap_sw_if_index == 0 || - pp->pcap_sw_if_index == vnet_buffer (b0)->sw_if_index[VLIB_RX]) - { - vnet_hw_interface_t *hi = - vnet_get_sup_hw_interface - (vnm, vnet_buffer (b0)->sw_if_index[VLIB_RX]); - - /* 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); - } + if (vnet_is_packet_pcaped (pp, b0, ~0)) + pcap_add_buffer (&pp->pcap_main, vm, bi0, pp->max_bytes_per_pkt); } } } -- cgit 1.2.3-korg