ganglia / monitor-core

Ganglia Monitoring core
BSD 3-Clause "New" or "Revised" License
490 stars 246 forks source link

fix net byte/packet stats on 32-bit linux #286

Closed bkurtz closed 6 years ago

bkurtz commented 7 years ago

32-bit linux systems often use 32-bit values for network byte/packet counters, but we've been assuming 64-bit rollover if the system supports strtoull. Per d17a120fe4a9905122ab521c5608d752e57246b6 (see #83), this was because some 32-bit systems use 64-bit network byte/packet counters, so it's not sufficient to check system type. Instead, just see if the previous value looks like a 32-bit or 64-bit value - if someone's going from a value that fits in 32 bits to one that's overflowed 64 in between checks, a) that's absurd bandwidth, and b) it's no longer a reasonable assumption that they only rolled over once either.

This fixes #140.