aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ping.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ping.c')
-rw-r--r--net/ipv6/ping.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c
index 2d3148378a1f..a2dfff6ff227 100644
--- a/net/ipv6/ping.c
+++ b/net/ipv6/ping.c
@@ -102,9 +102,10 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
102 102
103 if (msg->msg_name) { 103 if (msg->msg_name) {
104 DECLARE_SOCKADDR(struct sockaddr_in6 *, u, msg->msg_name); 104 DECLARE_SOCKADDR(struct sockaddr_in6 *, u, msg->msg_name);
105 if (msg->msg_namelen < sizeof(struct sockaddr_in6) || 105 if (msg->msg_namelen < sizeof(*u))
106 u->sin6_family != AF_INET6) {
107 return -EINVAL; 106 return -EINVAL;
107 if (u->sin6_family != AF_INET6) {
108 return -EAFNOSUPPORT;
108 } 109 }
109 if (sk->sk_bound_dev_if && 110 if (sk->sk_bound_dev_if &&
110 sk->sk_bound_dev_if != u->sin6_scope_id) { 111 sk->sk_bound_dev_if != u->sin6_scope_id) {
@@ -163,8 +164,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
163 pfh.icmph.checksum = 0; 164 pfh.icmph.checksum = 0;
164 pfh.icmph.un.echo.id = inet->inet_sport; 165 pfh.icmph.un.echo.id = inet->inet_sport;
165 pfh.icmph.un.echo.sequence = user_icmph.icmp6_sequence; 166 pfh.icmph.un.echo.sequence = user_icmph.icmp6_sequence;
166 /* XXX: stripping const */ 167 pfh.msg = msg;
167 pfh.iov = (struct iovec *)msg->msg_iter.iov;
168 pfh.wcheck = 0; 168 pfh.wcheck = 0;
169 pfh.family = AF_INET6; 169 pfh.family = AF_INET6;
170 170