Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 123404
Collapse All | Expand All

(-)watchdog-5.2.4.orig/include/extern.h (-1 / +3 lines)
Lines 23-31 Link Here
23
	int mtime;
23
	int mtime;
24
};
24
};
25
25
26
#define NETDEV_MAX_RX      50  /* max number of digits the traffic counter may have */
27
26
struct ifmode
28
struct ifmode
27
{
29
{
28
	unsigned int bytes;
30
	char bytes[NETDEV_MAX_RX];
29
};
31
};
30
32
31
union wdog_options
33
union wdog_options
(-)watchdog-5.2.4.orig/src/iface.c (-4 / +5 lines)
Lines 58-72 Link Here
58
			
58
			
59
		for (; line[i] == ' ' || line[i] == '\t'; i++);
59
		for (; line[i] == ' ' || line[i] == '\t'; i++);
60
		if (strncmp(line + i, dev->name, strlen(dev->name)) == 0) {
60
		if (strncmp(line + i, dev->name, strlen(dev->name)) == 0) {
61
			unsigned int bytes = atoi(line + i + strlen(dev->name) + 1);
61
			char *bytes, delimiter[] = " ";
62
			bytes = strtok(line + i + strlen(dev->name) + 1, delimiter);
62
			
63
			
63
#if USE_SYSLOG
64
#if USE_SYSLOG
64
			/* do verbose logging */
65
			/* do verbose logging */
65
			if (verbose)
66
			if (verbose)
66
		            syslog(LOG_INFO, "device %s received %u bytes", dev->name, bytes);
67
		            syslog(LOG_INFO, "device %s received %s bytes", dev->name, bytes);
67
#endif   
68
#endif   
68
69
69
			if (dev->parameter.iface.bytes == bytes) {
70
			if (strcmp(dev->parameter.iface.bytes, bytes) == 0) {
70
				fclose(file);
71
				fclose(file);
71
#if USE_SYSLOG
72
#if USE_SYSLOG
72
		            	syslog(LOG_INFO, "device %s did not receive anything since last check", dev->name);
73
		            	syslog(LOG_INFO, "device %s did not receive anything since last check", dev->name);
Lines 75-81 Link Here
75
				return (ENETUNREACH);
76
				return (ENETUNREACH);
76
			}
77
			}
77
			else
78
			else
78
				dev->parameter.iface.bytes = bytes;
79
				strncpy(dev->parameter.iface.bytes, bytes, NETDEV_MAX_RX);
79
		}
80
		}
80
        }
81
        }
81
    }
82
    }

Return to bug 123404