From: Eric Dumazet Date: Sat, 19 Jan 2013 16:10:37 +0000 (+0000) Subject: tcp: fix incorrect LOCKDROPPEDICMPS counter X-Git-Tag: v3.8~69^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b74aa930ef49a3c0d8e4c1987f89decac768fb2c;p=platform%2Fkernel%2Flinux-amlogic.git tcp: fix incorrect LOCKDROPPEDICMPS counter commit 563d34d057 (tcp: dont drop MTU reduction indications) added an error leading to incorrect accounting of LINUX_MIB_LOCKDROPPEDICMPS If socket is owned by the user, we want to increment this SNMP counter, unless the message is a (ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED) one. Reported-by: Maciej Żenczykowski Signed-off-by: Eric Dumazet Cc: Neal Cardwell Signed-off-by: Maciej Żenczykowski Acked-by: Neal Cardwell Signed-off-by: David S. Miller --- diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 54139fa..70b09ef 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -369,11 +369,10 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) * We do take care of PMTU discovery (RFC1191) special case : * we can receive locally generated ICMP messages while socket is held. */ - if (sock_owned_by_user(sk) && - type != ICMP_DEST_UNREACH && - code != ICMP_FRAG_NEEDED) - NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS); - + if (sock_owned_by_user(sk)) { + if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED)) + NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS); + } if (sk->sk_state == TCP_CLOSE) goto out;