提交 b5bf5927 编写于 作者: A Alex Shumsky 提交者: Hannu Nyman

collectd-mod-ipstatistics: fix handling of long `/proc` lines

`/proc/net/netstat` `TcpExt:` line is 2064 chars long on linux 6.1
Signed-off-by: NAlex Shumsky <alexthreed@gmail.com>
[PKG_RELEASE bump added]
上级 4299e892
......@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=collectd
PKG_VERSION:=5.12.0
PKG_RELEASE:=47
PKG_RELEASE:=48
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=https://collectd.org/files/ \
......
......@@ -41,7 +41,7 @@
+
+int ipstatistics_read() {
+ FILE *fh;
+ char buffer[1024];
+ char buffer[4096];
+ char *fields[19];
+ int numfields;
+
......@@ -56,7 +56,7 @@
+ return -1;
+ }
+
+ while (fgets(buffer, 1024, fh) != NULL) {
+ while (fgets(buffer, 4096, fh) != NULL) {
+ numfields = strsplit(buffer, fields, 2);
+
+ if (numfields < 2)
......@@ -80,7 +80,7 @@
+ }
+
+ int count_ipext = 0;
+ while (fgets(buffer, 1024, fh) != NULL) {
+ while (fgets(buffer, 4096, fh) != NULL) {
+ numfields = strsplit(buffer, fields, 19);
+
+ if (numfields < 8)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册