summaryrefslogtreecommitdiffstats
path: root/net/ipv6/ping.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-03-10 04:38:02 +0100
committerDavid S. Miller <davem@davemloft.net>2015-03-10 04:38:02 +0100
commit3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14 (patch)
tree02e95f15bd8a04071a9a36f534a92a066a8ce66a /net/ipv6/ping.c
parentnet: bcmgenet: core changes for supporting multiple Rx queues (diff)
parentMerge git://git.kernel.org/pub/scm/virt/kvm/kvm (diff)
downloadlinux-3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14.tar.xz
linux-3cef5c5b0b56f3f90b0e9ff8d3f8dc57f464cc14.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/cadence/macb.c Overlapping changes in macb driver, mostly fixes and cleanups in 'net' overlapping with the integration of at91_ether into macb in 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/ping.c')
-rw-r--r--net/ipv6/ping.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index fee25c0ed1f5..263a5164a6f5 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -101,9 +101,10 @@ int ping_v6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
if (msg->msg_name) {
DECLARE_SOCKADDR(struct sockaddr_in6 *, u, msg->msg_name);
- if (msg->msg_namelen < sizeof(struct sockaddr_in6) ||
- u->sin6_family != AF_INET6) {
+ if (msg->msg_namelen < sizeof(*u))
return -EINVAL;
+ if (u->sin6_family != AF_INET6) {
+ return -EAFNOSUPPORT;
}
if (sk->sk_bound_dev_if &&
sk->sk_bound_dev_if != u->sin6_scope_id) {