summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-05-23 00:46:30 +0000
committerMike Frysinger <vapier@gentoo.org>2005-05-23 00:46:30 +0000
commit7865772df124d9b4c5edfb390dd0e01264744d8d (patch)
treee942af797ab5473e2d95c9326cb2d3119198904d /net-analyzer/vnstat/files
parentStable on SPARC. (diff)
downloadhistorical-7865772df124d9b4c5edfb390dd0e01264744d8d.tar.gz
historical-7865772df124d9b4c5edfb390dd0e01264744d8d.tar.bz2
historical-7865772df124d9b4c5edfb390dd0e01264744d8d.zip
Add patch by Aleksey Fedoseev to support ifaces with long names.
Package-Manager: portage-2.0.51.22-r1
Diffstat (limited to 'net-analyzer/vnstat/files')
-rw-r--r--net-analyzer/vnstat/files/digest-vnstat-1.4-r11
-rw-r--r--net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch49
2 files changed, 50 insertions, 0 deletions
diff --git a/net-analyzer/vnstat/files/digest-vnstat-1.4-r1 b/net-analyzer/vnstat/files/digest-vnstat-1.4-r1
new file mode 100644
index 000000000000..c2424fe6d2b1
--- /dev/null
+++ b/net-analyzer/vnstat/files/digest-vnstat-1.4-r1
@@ -0,0 +1 @@
+MD5 9184f79b5e60499bc059f670032291e5 vnstat-1.4.tar.gz 26237
diff --git a/net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch b/net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch
new file mode 100644
index 000000000000..ba869b6fb7dd
--- /dev/null
+++ b/net-analyzer/vnstat/files/vnstat-1.4-long_iface_name.patch
@@ -0,0 +1,49 @@
+Interface names can be more than 7 chars long.
+
+Patch by Aleksey Fedoseev.
+
+--- vnstat-1.4/src/proc.c
++++ vnstat-1.4/src/proc.c
+@@ -64,6 +64,7 @@
+ void parseproc(int newdb)
+ {
+ char temp[64];
++ char* colon_pos;
+ uint64_t rx, tx, rxchange=0, txchange=0, btime; /* rxchange = rx change in MB */
+ uint64_t krxchange=0, ktxchange=0; /* krxchange = rx change in kB */
+ time_t current;
+@@ -86,12 +87,22 @@
+
+ current=time(NULL);
+
+- /* get rx from procline, easy since it's always procline+7 */
++ /* get rx position, then get it from procline */
++
++ colon_pos = strchr(procline, ':');
++ if (colon_pos == NULL) {
++ if (debug) {
++ printf("Bad /proc/net/dev string");
++ }
++ return;
++ }
++
++ colon_pos++;
+
+ #ifdef BLIMIT
+- rx=strtoull(procline+7, (char **)NULL, 0);
++ rx=strtoull(colon_pos, (char **)NULL, 0);
+ #else
+- rx=strtoul(procline+7, (char **)NULL, 0);
++ rx=strtoul(colon_pos, (char **)NULL, 0);
+ #endif
+
+ if (newdb!=1) {
+@@ -116,7 +127,7 @@
+
+
+ /* get tx from procline, ugly hack */
+- sscanf(procline+7,"%s %s %s %s %s %s %s %s %s",temp,temp,temp,temp,temp,temp,temp,temp,temp);
++ sscanf(colon_pos, "%s %s %s %s %s %s %s %s %s",temp,temp,temp,temp,temp,temp,temp,temp,temp);
+
+ #ifdef BLIMIT
+ tx=strtoull(temp, (char **)NULL, 0);