From 53437d5216223a4e34348ef7e64be34dcfed2d72 Mon Sep 17 00:00:00 2001 From: Shlomo Shachar Date: Tue, 1 Jan 2013 15:23:06 +0200 Subject: [PATCH] Fix bug in LinuxPort::StatsMonitor::netlinkStats() causing some ports not to be updated on system with many ports. Problem occurs as the netlink msg size is calculated once and then received multiple times. The following commit makes sure the netlink msg size is recalcaulted before each recv. Fixes issue 94 --- server/linuxport.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/linuxport.cpp b/server/linuxport.cpp index a04df1e..18cf525 100644 --- a/server/linuxport.cpp +++ b/server/linuxport.cpp @@ -437,6 +437,10 @@ int LinuxPort::StatsMonitor::netlinkStats() return -1; } + count = 0; + +_retry: + // Find required size of buffer and resize accordingly while (1) { @@ -486,9 +490,6 @@ int LinuxPort::StatsMonitor::netlinkStats() } } - count = 0; - -_retry: msg.msg_flags = 0; // Actually receive the reply now