mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Propagate BPF_Program error message to script land
This commit is contained in:
parent
b30d5702f6
commit
f8bc23d3e1
4 changed files with 18 additions and 16 deletions
|
@ -281,10 +281,17 @@ function install(): bool
|
|||
NOTICE([$note=Compile_Failure,
|
||||
$msg=fmt("Compiling packet filter failed"),
|
||||
$sub=tmp_filter]);
|
||||
|
||||
local error_string = fmt("Bad pcap filter '%s'", tmp_filter);
|
||||
|
||||
local pkt_src_error : string = Pcap::error();
|
||||
if ( pkt_src_error != "no error" )
|
||||
error_string = pkt_src_error;
|
||||
|
||||
if ( network_time() == 0.0 )
|
||||
Reporter::fatal(fmt("Bad pcap filter '%s'", tmp_filter));
|
||||
Reporter::fatal(error_string);
|
||||
else
|
||||
Reporter::warning(fmt("Bad pcap filter '%s'", tmp_filter));
|
||||
Reporter::warning(error_string);
|
||||
}
|
||||
local diff = current_time()-ts;
|
||||
if ( diff > max_filter_compile_time )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue