* More slow-UIDL patches from Wolfgang Wander.
* Yet another attempt to fix IMAP-K4. This one, my beta-testers say, works.
* Only re-poll on actual dispatches (not just fetches).
+* kwrohrer's patch for interface option on newer Linux kernels.
There are 262 people on fetchmail-friends and 54 on fetchmail-announce.
struct ifreq request;
char *cp, buffer[256];
int found = 0;
+ int counts[4];
/* initialize result */
memset((char *) ifinfo, 0, sizeof(ifinfo_t));
if (!strncmp(cp, ifname, namelen) &&
cp[namelen] == ':') {
cp += namelen + 1;
- sscanf(cp, "%d %*d %*d %*d %*d %d %*d %*d %*d %*d %*d",
- &ifinfo->rx_packets, &ifinfo->tx_packets);
+ if (sscanf(cp, "%d %d %*d %*d %*d %d %*d %d %*d %*d"
+ " %*d %*d %d",counts, counts+1, counts+2,
+ counts+3,&found)>4) { /* found = dummy */
+ /* newer kernel with byte counts */
+ ifinfo->rx_packets=counts[1];
+ ifinfo->tx_packets=counts[3];
+ } else {
+ /* older kernel, no byte counts */
+ ifinfo->rx_packets=counts[0];
+ ifinfo->tx_packets=counts[2];
+ }
found = 1;
}
}