Network traffic is reported to send and receive the total sent and received bytes *per second*, e.g.: Download speed: 501,7 MiB/s Upload speed: 52,6 MiB/s This happens because interfaces appear twice in struct ifaddrs, first as AF_LINK and then as AF_INET. Now, the AF_INET one has a lower amount of sent and received bytes, as shown by the output of a test program I wrote: interface: wlan0 level: data link received packets: 547021 sent packets: 430088 received bytes: 509.2 MiB sent bytes: 58.4 MiB interface: wlan0 level: network received packets: 543989 sent packets: 428187 received bytes: 501.7 MiB sent bytes: 52.6 MiB Both interfaces call incBytes() with their respective byte values, which triggers incBytes() overflow detection bits. I'm attaching a patch which solves the issue. Packets and bytes statistics are moved to AF_INET section, while other statistics are kept in the top level as they're reported by the AF_LINK interface (but there's no reason to move them down to its section). Reproducible: Always While here, I'm also fixing a wrong assignment (s/==/=/) and a Yoda condition.
Created attachment 71692 [details] Fix to the issue.
Created attachment 71708 [details] New patch with fix for the multiple IPs bug The same bug happens when multiple IP addresses are assigned to an interface, as this creates another entry in the list, and overflow check can be triggered: interface: wlan0 level: network received packets: 338529 sent packets: 286606 received bytes: 291.2 MiB sent bytes: 38.7 MiB interface: wlan0 level: network received packets: 0 sent packets: 0 received bytes: 0.0 MiB sent bytes: 0.0 MiB This new patch fixes this issue by calculating a sum of the bytes and packets of all network-level interfaces and then calling incBytes() after the for() cycle. Overflow of the sum is correctly caught by the incBytes() function.
Created attachment 71713 [details] Fix for the "always active" regression Sorry, the attached patch introduced a regression which resets prevRxPackets and prevTxPackets on every update() call, thus making the interface think to be always receiving and sending data. The attached patch fixes it.
Thank you for taking the time to work on this (and bug 301557). I'll take a look at them and commit soon.
SVN commit 1299925 by jstamp: Fix wrong traffic reported on FreeBSD Kudos to Alberto Villa for the patch. M +25 -14 bsdbackend.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=1299925
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I will be closing this bug.