mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Do not lookup ignore_checksums_nets for every packet
This could lead to a noticeable (single-percent) performance improvement. Most of the functionality for this is in the packet analyzers that now cache ignore_chesksums_nets. Based on a patch by Arne Welzel (Corelight).
This commit is contained in:
parent
d24cecf268
commit
8192ad581d
13 changed files with 101 additions and 7 deletions
|
@ -18,7 +18,6 @@ TCPAnalyzer::TCPAnalyzer() : IPBasedAnalyzer("TCP", TRANSPORT_TCP, TCP_PORT_MASK
|
|||
|
||||
void TCPAnalyzer::Initialize()
|
||||
{
|
||||
ignored_nets = zeek::id::find_val<TableVal>("ignore_checksums_nets");
|
||||
}
|
||||
|
||||
SessionAdapter* TCPAnalyzer::MakeSessionAdapter(Connection* conn)
|
||||
|
@ -164,7 +163,7 @@ bool TCPAnalyzer::ValidateChecksum(const IP_Hdr* ip, const struct tcphdr* tp,
|
|||
{
|
||||
if ( ! run_state::current_pkt->l3_checksummed &&
|
||||
! detail::ignore_checksums &&
|
||||
! ignored_nets->Contains(ip->IPHeaderSrcAddr()) &&
|
||||
! GetIgnoreChecksumsNets()->Contains(ip->IPHeaderSrcAddr()) &&
|
||||
caplen >= len && ! endpoint->ValidChecksum(tp, len, ip->IP4_Hdr()) )
|
||||
{
|
||||
adapter->Weird("bad_TCP_checksum");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue