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
This commit is contained in:
Shlomo Shachar 2013-01-01 15:23:06 +02:00
parent 1d5ae64281
commit 53437d5216

View File

@ -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