mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
f66ef2d064
commit
1f8438a853
4 changed files with 7 additions and 2 deletions
|
|
@ -482,6 +482,7 @@ route_done:
|
|||
np->tclass, NULL, &fl, (struct rt6_info*)dst,
|
||||
MSG_DONTWAIT);
|
||||
if (err) {
|
||||
ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTMSGS);
|
||||
ip6_flush_pending_frames(sk);
|
||||
goto out_put;
|
||||
}
|
||||
|
|
@ -562,6 +563,7 @@ static void icmpv6_echo_reply(struct sk_buff *skb)
|
|||
(struct rt6_info*)dst, MSG_DONTWAIT);
|
||||
|
||||
if (err) {
|
||||
ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTMSGS);
|
||||
ip6_flush_pending_frames(sk);
|
||||
goto out_put;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ static const struct snmp_mib snmp6_icmp6_list[] = {
|
|||
SNMP_MIB_ITEM("Icmp6InMsgs", ICMP6_MIB_INMSGS),
|
||||
SNMP_MIB_ITEM("Icmp6InErrors", ICMP6_MIB_INERRORS),
|
||||
SNMP_MIB_ITEM("Icmp6OutMsgs", ICMP6_MIB_OUTMSGS),
|
||||
SNMP_MIB_ITEM("Icmp6OutErrors", ICMP6_MIB_OUTERRORS),
|
||||
SNMP_MIB_SENTINEL
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue