mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 04:58:21 +00:00
If IPv6 default is not compiled in, the default BPF filters now
excludes IPv6 packets.
This commit is contained in:
parent
ee872c12c8
commit
0815ea9188
1 changed files with 10 additions and 1 deletions
|
@ -58,8 +58,13 @@ function build_default_pcap_filter(): string
|
|||
return cmd_line_bpf_filter;
|
||||
|
||||
if ( all_packets )
|
||||
{
|
||||
# Return an "always true" filter.
|
||||
return "ip or not ip";
|
||||
if ( bro_has_ipv6() )
|
||||
return "ip or not ip";
|
||||
else
|
||||
return "not ip6";
|
||||
}
|
||||
|
||||
## Build filter dynamically.
|
||||
|
||||
|
@ -76,6 +81,10 @@ function build_default_pcap_filter(): string
|
|||
# Finally, join them.
|
||||
local filter = join_filters(cfilter, rfilter);
|
||||
|
||||
# Exclude IPv6 if we don't support it.
|
||||
if ( ! bro_has_ipv6() )
|
||||
filter = fmt("(not ip6) and (%s)", filter);
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue