net: Add MIB counters for checksum errors
Add MIB counters for checksum errors in IP layer, and TCP/UDP/ICMP layers, to help diagnose problems. $ nstat -a | grep Csum IcmpInCsumErrors 72 0.0 TcpInCsumErrors 382 0.0 UdpInCsumErrors 463221 0.0 Icmp6InCsumErrors 75 0.0 Udp6InCsumErrors 173442 0.0 IpExtInCsumErrors 10884 0.0 Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
f233a976ad
commit
6a5dc9e598
@@ -881,7 +881,7 @@ int icmp_rcv(struct sk_buff *skb)
|
||||
case CHECKSUM_NONE:
|
||||
skb->csum = 0;
|
||||
if (__skb_checksum_complete(skb))
|
||||
goto error;
|
||||
goto csum_error;
|
||||
}
|
||||
|
||||
if (!pskb_pull(skb, sizeof(*icmph)))
|
||||
@@ -929,6 +929,8 @@ int icmp_rcv(struct sk_buff *skb)
|
||||
drop:
|
||||
kfree_skb(skb);
|
||||
return 0;
|
||||
csum_error:
|
||||
ICMP_INC_STATS_BH(net, ICMP_MIB_CSUMERRORS);
|
||||
error:
|
||||
ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
|
||||
goto drop;
|
||||
|
Reference in New Issue
Block a user