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

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
...@@ -339,7 +339,6 @@ void ping_err(struct sk_buff *skb, u32 info) ...@@ -339,7 +339,6 @@ void ping_err(struct sk_buff *skb, u32 info)
sk = ping_v4_lookup(net, iph->daddr, iph->saddr, sk = ping_v4_lookup(net, iph->daddr, iph->saddr,
ntohs(icmph->un.echo.id), skb->dev->ifindex); ntohs(icmph->un.echo.id), skb->dev->ifindex);
if (sk == NULL) { if (sk == NULL) {
ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
pr_debug("no socket, dropping\n"); pr_debug("no socket, dropping\n");
return; /* No socket for error */ return; /* No socket for error */
} }
...@@ -679,7 +678,6 @@ static int ping_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) ...@@ -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", pr_debug("ping_queue_rcv_skb(sk=%p,sk->num=%d,skb=%p)\n",
inet_sk(sk), inet_sk(sk)->inet_num, skb); inet_sk(sk), inet_sk(sk)->inet_num, skb);
if (sock_queue_rcv_skb(sk, skb) < 0) { if (sock_queue_rcv_skb(sk, skb) < 0) {
ICMP_INC_STATS_BH(sock_net(sk), ICMP_MIB_INERRORS);
kfree_skb(skb); kfree_skb(skb);
pr_debug("ping_queue_rcv_skb -> failed\n"); pr_debug("ping_queue_rcv_skb -> failed\n");
return -1; return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment