From 85bc4924e0c54aa8fa8d57e062c6eed986fcbc73 Mon Sep 17 00:00:00 2001 From: Kaian Date: Mon, 21 Aug 2023 13:01:01 +0200 Subject: [PATCH] capture: only validate BPF filters against libpcap sources #452 --- src/capture.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/capture.c b/src/capture.c index 3cbabee..e1a4163 100644 --- a/src/capture.c +++ b/src/capture.c @@ -1099,6 +1099,10 @@ capture_set_bpf_filter(const char *filter) // Apply the given filter to all sources while ((capinfo = vector_iterator_next(&it))) { + //! Only try to validate bpf filter for pcap sources + if (!capinfo->ispcap) + continue; + //! Check if filter compiles if (pcap_compile(capinfo->handle, &capture_cfg.fp, filter, 0, capinfo->mask) == -1) return 1;