aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/ipv4/ping.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-11-29 20:47:48 -0800
committerDavid S. Miller <davem@davemloft.net>2014-11-29 20:47:48 -0800
commit60b7379dc5b1743427b031cca53e30860a38ada6 (patch)
treec0462b8dd188861bd04f36dd31672b7446e35dd8 /net/ipv4/ping.c
parentmacvlan: delay the header check for dodgy packets into lower device (diff)
parentMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (diff)
downloadwireguard-linux-60b7379dc5b1743427b031cca53e30860a38ada6.tar.xz
wireguard-linux-60b7379dc5b1743427b031cca53e30860a38ada6.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/ipv4/ping.c')
-rw-r--r--net/ipv4/ping.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index ef8f6ee90473..8dd4ae0424fc 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -217,6 +217,8 @@ static struct sock *ping_lookup(struct net *net, struct sk_buff *skb, u16 ident)
&ipv6_hdr(skb)->daddr))
continue;
#endif
+ } else {
+ continue;
}
if (sk->sk_bound_dev_if && sk->sk_bound_dev_if != dif)
@@ -853,16 +855,8 @@ int ping_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (flags & MSG_OOB)
goto out;
- if (flags & MSG_ERRQUEUE) {
- if (family == AF_INET) {
- return ip_recv_error(sk, msg, len, addr_len);
-#if IS_ENABLED(CONFIG_IPV6)
- } else if (family == AF_INET6) {
- return pingv6_ops.ipv6_recv_error(sk, msg, len,
- addr_len);
-#endif
- }
- }
+ if (flags & MSG_ERRQUEUE)
+ return inet_recv_error(sk, msg, len, addr_len);
skb = skb_recv_datagram(sk, flags, noblock, &err);
if (!skb)