On Wed, Aug 15, 2001 at 11:00:47AM +0000, mprice wrote: > > Hi Folks, > > I've been working on fixing some of the kernel level network counters > which are used by SNMP, and need a little advice. This is in the 2.4.2 > kernel, but appears to be the same in 2.4.7. > > One of bugs is related to IpInDelivers which is not incremented when an > incoming ICMP is delivered to icmp_rcv(). Looked like an easy enough fix > by calling IP_INC_STATS_BH(IpInDelivers) at the top of icmp_rcv(). I think it would be a better fix to move the counter increase to ip_local_deliver and remove these from the protocols. There are also some other counters missing, for example there are still out of memory situations where packets are dropped silently without any counter getting increased. > increment the IpInDelivers. Sort of nasty, looking at different level. > > 2. Don't increment IpInDelivers at all in the raw code. > > 3. Let it increment it twice as it was delivered to two different > handlers. Although this then leads to rather odd counters where > IpInDelivers is larger than IpInReceives. If you move it to ip_local_deliver it comes natural -- increment it once either in the fast path or if flag != 0. Make sure to do it before the function call in the fast path to allow the compiler to do sibling call optimization. -Andi - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html