]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Fix a crash in the TCP concurrent connections map 15554/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 13 May 2025 07:20:22 +0000 (09:20 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Tue, 13 May 2025 07:20:22 +0000 (09:20 +0200)
The bug was introduced in 99d1e8f044d43b9a75ffc70fed22ea674a9b7859.
Thanks to Robert Edmonds for finding, reporting and proposing a patch
fixing the issue!

pdns/dnsdistdist/dnsdist-concurrent-connections.cc

index c2f2c646575f5cbc0575f090f653bc682869a8d2..8669fb6eb8f3e53acae068b81984444aedf54d41 100644 (file)
@@ -71,7 +71,7 @@ using map_t = boost::multi_index_container<
     boost::multi_index::ordered_non_unique<boost::multi_index::tag<TimeTag>,
                                            boost::multi_index::member<ClientEntry, time_t, &ClientEntry::d_lastSeen>>>>;
 
-static std::vector<LockGuarded<map_t>> s_tcpClientsConnectionMetrics{10};
+static std::vector<LockGuarded<map_t>> s_tcpClientsConnectionMetrics{NB_SHARDS};
 
 static AddressAndPortRange getRange(const ComboAddress& from)
 {