capture: only validate BPF filters against libpcap sources #452

This commit is contained in:
Kaian 2023-08-21 13:01:01 +02:00
parent b086bf7ac4
commit 85bc4924e0
1 changed files with 4 additions and 0 deletions

View File

@ -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;