Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sbin/ifconfig



> Module Name:  src
> Committed By: perry
> Date:         Sat Apr 12 01:07:44 UTC 2003
>
> Modified Files:
>       src/sbin/ifconfig: ifconfig.c
>
> Log Message:
> Add an option (-z) like -v except that it clears the input/output
> stats after printing them.
> (Basically this just calls SIOCZIFDATA instead of SIOCGIFDATA).
> Submitted by Jean-Edouard BABIN in PR bin/21078
> However, he suggested using -c, and cgd (reasonably) noted that -z for
> "zero" was probably more reasonable.
> I've also changed the code very slightly.
> ...
> cvs rdiff -r1.133 -r1.134 src/sbin/ifconfig/ifconfig.c

If this does what I think it does (after browsing the code, I think it
does), zeroing the packet statistics will break the monotonous
increase of counters restriction imposed on SNMP agents (excepted are,
of course, what happens after a cold start, but then sysUpTime is
reset so this is detectable by a management station), and an SNMP
agent running on the box would therefore misbehave when the packet
stats are zeroed.  This is BAD, and can easily cause network
monitoring software to think that the counter has wrapped, causing a
HUGE spike in the computed deltas for the preceding time interval.

Instead the packet statistics clearing should be done by establishing
a new baseline for the counters which netstat and other similar
user-oriented programs could use when presenting the new totals to the
user, much in the same way Cisco does when you do "clear counters" on
an interface.  However, just pulling the rug under an SNMP agent's
feet as is done here is not the right thing to do.

I know, this is perhaps more a criticism of the implementation of
SIOCZIFDATA than this particular snippet of code, though exposing the
knob even more (as is done here) makes this more of a problem.

Regards,

- Havard



Home | Main Index | Thread Index | Old Index