Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b74aa930 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

tcp: fix incorrect LOCKDROPPEDICMPS counter



commit 563d34d0 (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: default avatarMaciej Żenczykowski <maze@google.com>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Acked-by: default avatarNeal Cardwell <ncardwell@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9a4c831e
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -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 do take care of PMTU discovery (RFC1191) special case :
	 * we can receive locally generated ICMP messages while socket is held.
	 * we can receive locally generated ICMP messages while socket is held.
	 */
	 */
	if (sock_owned_by_user(sk) &&
	if (sock_owned_by_user(sk)) {
	    type != ICMP_DEST_UNREACH &&
		if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED))
	    code != ICMP_FRAG_NEEDED)
			NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);
			NET_INC_STATS_BH(net, LINUX_MIB_LOCKDROPPEDICMPS);

	}
	if (sk->sk_state == TCP_CLOSE)
	if (sk->sk_state == TCP_CLOSE)
		goto out;
		goto out;