ksysguardd fails to grab vlan stats on Ubuntu 12.04 LTS
I am trying to use ksysguard to grab stats for multiple interfaces. When I select say eth0, it works. When I select a vlan, say eth0.101, it fails and just returns zeros for all stats I can think to ask for. I downloaded and looked at the source code to pine around for ideas and I came up with the file:
/kde-workspace-
Before this line on line 191 it looks like the parser for the /proc/net/dev file looks for the ':' token in the interface stat line it is looking at. However on line 196 it assumes this token is at position 7 of the line. Actual code [ sscanf(buf + 7, "%llu %llu %llu %llu %llu %llu %llu %llu " ]. The problem I see with this is the device label of say "eth0.101:" is greater than 7 characters. I figure this is bound to cause issues specific to longer than seven character named vlan devices that would not be seen with shorter named devices such as eth0. I would think doing something like pointer arithmetic of say take the 'buf' pointer minus the 'pos' pointer plus 1 in place of the hard coded 7 on line 196 would work a lot better in the case one is trying to parse out vlan device stats as it would start the sscanf() parser in the right place.
If possible would like advise of how to fix this and get it right as for example I am not familiar with patching bugs beyond knowledge that launchpad exists, basic Linux usage knowledge, and some C and C++ knowledge. I am still trying to figure out things like how does one recompile KDE specific apps such as this one.
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- BatteryKing
- Solved:
- Last query:
- Last reply: