summaryrefslogtreecommitdiffstats
path: root/src/vnet/ethernet/node.c
diff options
context:
space:
mode:
authorBenoît Ganne <bganne@cisco.com>2021-02-26 13:47:41 +0100
committerDave Barach <openvpp@barachs.net>2021-04-17 11:55:33 +0000
commit30a819579cb396db1c975ae8e08477129aa7950d (patch)
tree67558f0c8782085b65833e9b8f4d885c9f027047 /src/vnet/ethernet/node.c
parent558ceabc6c08f275ce6c6e7ff295e74272eb851a (diff)
classify: honor pcap interface filter also when classify filter is used
Type: fix Change-Id: Ic32550ee9c5d76d232d8b67a7810611f6c8b9177 Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/ethernet/node.c')
-rw-r--r--src/vnet/ethernet/node.c31
1 files changed, 3 insertions, 28 deletions
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 <vnet/devices/pipe/pipe.h>
#include <vppinfra/sparse_vec.h>
#include <vnet/l2/l2_bvi.h>
-#include <vnet/classify/trace_classify.h>
+#include <vnet/classify/pcap_classify.h>
#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);
}
}
}