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

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

ping: dont increment ICMP_MIB_INERRORS



ping module incorrectly increments ICMP_MIB_INERRORS if feeded with a
frame not belonging to its own sockets.

RFC 2011 states that ICMP_MIB_INERRORS should count "the number of ICMP
messages which the entiry received but determined as having
ICMP-specific errors (bad ICMP checksums, bad length, etc.)."

Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
CC: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: default avatarFlavio Leitner <fbl@redhat.com>
Acked-by: default avatarVasiliy Kulikov <segoon@openwall.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 282edcec
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -339,7 +339,6 @@ void ping_err(struct sk_buff *skb, u32 info)
	sk = ping_v4_lookup(net, iph->daddr, iph->saddr,
			    ntohs(icmph->un.echo.id), skb->dev->ifindex);
	if (sk == NULL) {
		ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
		pr_debug("no socket, dropping\n");
		return;	/* No socket for error */
	}
@@ -679,7 +678,6 @@ static int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
	pr_debug("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n",
		inet_sk(sk), inet_sk(sk)->inet_num, skb);
	if (sock_queue_rcv_skb(sk, skb) < 0) {
		ICMP_INC_STATS_BH(sock_net(sk), ICMP_MIB_INERRORS);
		kfree_skb(skb);
		pr_debug("ping_queue_rcv_skb -> failed\n");
		return -1;