icmp: Account for ICMP out errors
authorEric Dumazet <eric.dumazet@gmail.com>
Sat, 3 Apr 2010 22:09:04 +0000 (15:09 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 3 Apr 2010 22:09:04 +0000 (15:09 -0700)
commit1f8438a853667d48055ad38384c63e94b32c6578
treed515b2246023abce5f151f35d70d270fa05b90c7
parentf66ef2d0649b220874532dfb83b6b5b368f83591
icmp: Account for ICMP out errors

When ip_append() fails because of socket limit or memory shortage,
increment ICMP_MIB_OUTERRORS counter, so that "netstat -s" can report
these errors.

LANG=C netstat -s | grep "ICMP messages failed"
    0 ICMP messages failed

For IPV6, implement ICMP6_MIB_OUTERRORS counter as well.

# grep Icmp6OutErrors /proc/net/dev_snmp6/*
/proc/net/dev_snmp6/eth0:Icmp6OutErrors                    0
/proc/net/dev_snmp6/lo:Icmp6OutErrors                    0

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/snmp.h
net/ipv4/icmp.c
net/ipv6/icmp.c
net/ipv6/proc.c