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 |
} |