Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 80309 Details for
Bug 123404
sys-apps/watchdog broken interface monitoring
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to resolve the iface limit using strings
watchdog_5.2.4-iface-byte-limit.diff (text/plain), 1.60 KB, created by
Christoph Probst
on 2006-02-20 13:40:42 UTC
(
hide
)
Description:
Patch to resolve the iface limit using strings
Filename:
MIME Type:
Creator:
Christoph Probst
Created:
2006-02-20 13:40:42 UTC
Size:
1.60 KB
patch
obsolete
>diff -r -u watchdog-5.2.4.orig/include/extern.h watchdog-5.2.4/include/extern.h >--- watchdog-5.2.4.orig/include/extern.h 2003-01-28 07:52:06.000000000 +0100 >+++ watchdog-5.2.4/include/extern.h 2006-02-20 13:37:48.000000000 +0100 >@@ -23,9 +23,11 @@ > int mtime; > }; > >+#define NETDEV_MAX_RX 50 /* max number of digits the traffic counter may have */ >+ > struct ifmode > { >- unsigned int bytes; >+ char bytes[NETDEV_MAX_RX]; > }; > > union wdog_options >diff -r -u watchdog-5.2.4.orig/src/iface.c watchdog-5.2.4/src/iface.c >--- watchdog-5.2.4.orig/src/iface.c 2003-01-28 07:47:38.000000000 +0100 >+++ watchdog-5.2.4/src/iface.c 2006-02-20 13:38:18.000000000 +0100 >@@ -58,15 +58,16 @@ > > for (; line[i] == ' ' || line[i] == '\t'; i++); > if (strncmp(line + i, dev->name, strlen(dev->name)) == 0) { >- unsigned int bytes = atoi(line + i + strlen(dev->name) + 1); >+ char *bytes, delimiter[] = " "; >+ bytes = strtok(line + i + strlen(dev->name) + 1, delimiter); > > #if USE_SYSLOG > /* do verbose logging */ > if (verbose) >- syslog(LOG_INFO, "device %s received %u bytes", dev->name, bytes); >+ syslog(LOG_INFO, "device %s received %s bytes", dev->name, bytes); > #endif > >- if (dev->parameter.iface.bytes == bytes) { >+ if (strcmp(dev->parameter.iface.bytes, bytes) == 0) { > fclose(file); > #if USE_SYSLOG > syslog(LOG_INFO, "device %s did not receive anything since last check", dev->name); >@@ -75,7 +76,7 @@ > return (ENETUNREACH); > } > else >- dev->parameter.iface.bytes = bytes; >+ strncpy(dev->parameter.iface.bytes, bytes, NETDEV_MAX_RX); > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 123404
: 80309