New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input netif always output value 0 if raw value is bigger than some value? #2366
Comments
After modify source to debug, seems that problem occur in modified source to debug (add printf):
in new virtual machine, it output ok:
Howeverin in production server,
|
@HorseLuke Thank you for reporting issue.
The kernel version of CentOS6.X is v2.6.32.xxx. seq_printf(seq, "%6s:%8lu %7lu %4lu %4lu %4lu %5lu %10lu %9lu "
"%8lu %7lu %4lu %4lu %4lu %5lu %7lu %10lu\n", https://github.com/torvalds/linux/blob/v2.6.32/net/core/dev.c#L3055 The point is On the other hand, v3.10.x the version of CentOS7 is like this. seq_printf(seq, "%6s: %7llu %7llu %4llu %4llu %4llu %5llu %10llu %9llu "
"%8llu %7llu %4llu %4llu %4llu %5llu %7llu %10llu\n", The format is updated like |
Thanks. I will find other method to do the same work. Closed as won't fix |
Sorry to bother @nokute78 . In
Then change code
This patch solve legacy kernel issue. But Is that OK? Or does it have some vuls like Buffer overflow? Because CentOS 6 will be EOL, I will not make a PR. Just paste code for those who needed. Thanks. |
I see. The patch is LGTM. memmove(line + finded_pos + 1, line + finded_pos, line_length - finded_pos); line + finded_pos = finded, so it will be memmove(finded+ 1, finded, line_length - finded_pos); I think it is easy to read. |
@nokute78 Sorry for slow reply. Thanks for review |
Bug Report
Describe the bug
Some servers online many years, and stats of network traffic reach TB bytes.
If use Input netif, it always output value 0.
I am not familiar with C, does the raw value which bigger than unsigned long make function
strtoul
inplugins/in_netif/in_netif.c
parse error? If so, how to fix it?Maybe mitigation method is bring down and up network card, but I cann't do that.
To Reproduce
cat /proc/net/dev
/opt/fluent-bit-1.3.2/bin/fluent-bit -i netif -p interface=eth0 -o stdout
Expected behavior
rx/tx/packets values is not 0 when network traffic increases.
Screenshots
(Copyed from terminal and delete some sensitive info)
Your Environment
Additional context
N/A
The text was updated successfully, but these errors were encountered: