--- rpc.rstatd-4.0.1/getdata.c 2005-12-07 09:11:04.000000000 +0000 +++ rpc.rstatd-4.0.1-fixed/getdata.c 2006-12-15 13:34:46.000000000 +0000 @@ -201,6 +201,12 @@ fgets(buf, sizeof(buf), fp); fgets(buf, sizeof(buf), fp); + stats->if_ipackets = 0; + stats->if_ierrors = 0; + stats->if_opackets = 0; + stats->if_oerrors = 0; + stats->if_collisions = 0; + /* add up data from all interfaces besides the loopback interface. If interfaces where specified on the commandline take only these. */ while (fgets(buf, sizeof(buf), fp)) { @@ -241,11 +247,6 @@ } } /* skip lo interfaces */ - stats->if_ipackets = 0; - stats->if_ierrors = 0; - stats->if_opackets = 0; - stats->if_oerrors = 0; - stats->if_collisions = 0; if ((ninterfaces == 0 && strcmp(iface, "lo") != 0) || found_interface) { stats->if_ipackets += if_ipackets;