diff --git a/CHANGES b/CHANGES index 8f605874e2..45cdc51c1d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,7 @@ +6.0.0-dev.595 | 2023-05-17 10:36:22 +0200 + + * Fix get_active_node_count for node types not present. (Jan Grashoefer, Corelight) + 6.0.0-dev.592 | 2023-05-17 09:02:09 +0200 * zeekygen: Render function parameters as :param x: instead of :x: (Arne Welzel, Corelight) diff --git a/VERSION b/VERSION index 49852c3668..c2367c5ee3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.0.0-dev.592 +6.0.0-dev.595 diff --git a/scripts/base/frameworks/cluster/main.zeek b/scripts/base/frameworks/cluster/main.zeek index ee2cf71681..495885c431 100644 --- a/scripts/base/frameworks/cluster/main.zeek +++ b/scripts/base/frameworks/cluster/main.zeek @@ -318,7 +318,7 @@ function Cluster::get_node_count(node_type: NodeType): count function Cluster::get_active_node_count(node_type: NodeType): count { - return |active_node_ids[node_type]|; + return node_type in active_node_ids ? |active_node_ids[node_type]| : 0; } function is_enabled(): bool @@ -377,7 +377,7 @@ event Cluster::hello(name: string, id: string) &priority=10 @pragma push ignore-deprecations if ( n$node_type == WORKER ) - worker_count = |active_node_ids[WORKER]|; + worker_count = get_active_node_count(WORKER); @pragma pop ignore-deprecations } @@ -402,7 +402,7 @@ event Broker::peer_lost(endpoint: Broker::EndpointInfo, msg: string) &priority=1 @pragma push ignore-deprecations if ( n$node_type == WORKER ) - worker_count = |active_node_ids[WORKER]|; + worker_count = get_active_node_count(WORKER); @pragma pop ignore-deprecations event Cluster::node_down(node_name, endpoint$id);