diff options
-rw-r--r-- | net/ipv4/ping.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index df6fbefe44d4..1c3d5d3702a1 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -963,6 +963,7 @@ bool ping_rcv(struct sk_buff *skb) struct sock *sk; struct net *net = dev_net(skb->dev); struct icmphdr *icmph = icmp_hdr(skb); + bool rc = false; /* We assume the packet has already been checked by icmp_rcv */ @@ -977,14 +978,15 @@ bool ping_rcv(struct sk_buff *skb) struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); pr_debug("rcv on socket %p\n", sk); - if (skb2) - ping_queue_rcv_skb(sk, skb2); + if (skb2 && !ping_queue_rcv_skb(sk, skb2)) + rc = true; sock_put(sk); - return true; } - pr_debug("no socket, dropping\n"); - return false; + if (!rc) + pr_debug("no socket, dropping\n"); + + return rc; } EXPORT_SYMBOL_GPL(ping_rcv); |