Skip to content

Instantly share code, notes, and snippets.

@tehnerd
Created June 18, 2018 17:36
Show Gist options
  • Save tehnerd/9626888dca92f556606efd8ec48c065e to your computer and use it in GitHub Desktop.
Save tehnerd/9626888dca92f556606efd8ec48c065e to your computer and use it in GitHub Desktop.
diff --git a/katran/lib/KatranLb.cpp b/katran/lib/KatranLb.cpp
index 2b7e0c6..e09e6fd 100644
--- a/katran/lib/KatranLb.cpp
+++ b/katran/lib/KatranLb.cpp
@@ -685,7 +685,9 @@ lb_stats KatranLb::getIcmpTooBigStats() {
lb_stats KatranLb::getLbStats(uint32_t position) {
unsigned int nr_cpus = sysconf(_SC_NPROCESSORS_CONF);
- lb_stats stats[nr_cpus];
+ lb_stats stats[nr_cpus<<1];
+ std::memset(stats, 0, sizeof(stats));
+ LOG(INFO) << "sizeof(stats)=" << sizeof(stats);
lb_stats sum_stat = {};
if (!testing_) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment