mirror of
https://github.com/zeek/zeek.git
synced 2025-10-15 21:18:20 +00:00
GH-1991: Add option to limit the number of tunnel_changed events
This commit is contained in:
parent
4deacefa4c
commit
a9fd4a60e0
5 changed files with 21 additions and 1 deletions
|
@ -96,8 +96,13 @@ void Connection::CheckEncapsulation(const std::shared_ptr<EncapsulationStack>& a
|
|||
{
|
||||
if ( *encapsulation != *arg_encap )
|
||||
{
|
||||
if ( tunnel_changed )
|
||||
if ( tunnel_changed &&
|
||||
(zeek::detail::tunnel_max_changes_per_connection == 0 ||
|
||||
tunnel_changes < zeek::detail::tunnel_max_changes_per_connection) )
|
||||
{
|
||||
tunnel_changes++;
|
||||
EnqueueEvent(tunnel_changed, nullptr, GetVal(), arg_encap->ToVal());
|
||||
}
|
||||
|
||||
encapsulation = std::make_shared<EncapsulationStack>(*arg_encap);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue