diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-27 20:34:16 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-02-04 01:34:14 -0500 |
| commit | cacdc7d2f9fa42e29b650e2879df42ea7d7833c1 (patch) | |
| tree | 45f0ff4663f193b759b74a58a4a902d7667abada | |
| parent | 2e90b1c45e34240eeeacab0b37d5f8f739462bdc (diff) | |
ip: stash a pointer to msghdr in struct ping_fakehdr
... instead of storing its ->mgs_iter.iov there
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| -rw-r--r-- | include/net/ping.h | 2 | ||||
| -rw-r--r-- | net/ipv4/ping.c | 7 | ||||
| -rw-r--r-- | net/ipv6/ping.c | 3 |
3 files changed, 5 insertions, 7 deletions
diff --git a/include/net/ping.h b/include/net/ping.h index f074060bc5de..cc16d413f681 100644 --- a/include/net/ping.h +++ b/include/net/ping.h | |||
| @@ -59,7 +59,7 @@ extern struct pingv6_ops pingv6_ops; | |||
| 59 | 59 | ||
| 60 | struct pingfakehdr { | 60 | struct pingfakehdr { |
| 61 | struct icmphdr icmph; | 61 | struct icmphdr icmph; |
| 62 | struct iovec *iov; | 62 | struct msghdr *msg; |
| 63 | sa_family_t family; | 63 | sa_family_t family; |
| 64 | __wsum wcheck; | 64 | __wsum wcheck; |
| 65 | }; | 65 | }; |
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 2a3720fb5a5f..9e15ba701401 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
| @@ -602,14 +602,14 @@ int ping_getfrag(void *from, char *to, | |||
| 602 | if (fraglen < sizeof(struct icmphdr)) | 602 | if (fraglen < sizeof(struct icmphdr)) |
| 603 | BUG(); | 603 | BUG(); |
| 604 | if (csum_partial_copy_fromiovecend(to + sizeof(struct icmphdr), | 604 | if (csum_partial_copy_fromiovecend(to + sizeof(struct icmphdr), |
| 605 | pfh->iov, 0, fraglen - sizeof(struct icmphdr), | 605 | pfh->msg->msg_iter.iov, 0, fraglen - sizeof(struct icmphdr), |
| 606 | &pfh->wcheck)) | 606 | &pfh->wcheck)) |
| 607 | return -EFAULT; | 607 | return -EFAULT; |
| 608 | } else if (offset < sizeof(struct icmphdr)) { | 608 | } else if (offset < sizeof(struct icmphdr)) { |
| 609 | BUG(); | 609 | BUG(); |
| 610 | } else { | 610 | } else { |
| 611 | if (csum_partial_copy_fromiovecend | 611 | if (csum_partial_copy_fromiovecend |
| 612 | (to, pfh->iov, offset - sizeof(struct icmphdr), | 612 | (to, pfh->msg->msg_iter.iov, offset - sizeof(struct icmphdr), |
| 613 | fraglen, &pfh->wcheck)) | 613 | fraglen, &pfh->wcheck)) |
| 614 | return -EFAULT; | 614 | return -EFAULT; |
| 615 | } | 615 | } |
| @@ -811,8 +811,7 @@ back_from_confirm: | |||
| 811 | pfh.icmph.checksum = 0; | 811 | pfh.icmph.checksum = 0; |
| 812 | pfh.icmph.un.echo.id = inet->inet_sport; | 812 | pfh.icmph.un.echo.id = inet->inet_sport; |
| 813 | pfh.icmph.un.echo.sequence = user_icmph.un.echo.sequence; | 813 | pfh.icmph.un.echo.sequence = user_icmph.un.echo.sequence; |
| 814 | /* XXX: stripping const */ | 814 | pfh.msg = msg; |
| 815 | pfh.iov = (struct iovec *)msg->msg_iter.iov; | ||
| 816 | pfh.wcheck = 0; | 815 | pfh.wcheck = 0; |
| 817 | pfh.family = AF_INET; | 816 | pfh.family = AF_INET; |
| 818 | 817 | ||
diff --git a/net/ipv6/ping.c b/net/ipv6/ping.c index 2d3148378a1f..bd46f736f61d 100644 --- a/net/ipv6/ping.c +++ b/net/ipv6/ping.c | |||
| @@ -163,8 +163,7 @@ int ping_v6_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
| 163 | pfh.icmph.checksum = 0; | 163 | pfh.icmph.checksum = 0; |
| 164 | pfh.icmph.un.echo.id = inet->inet_sport; | 164 | pfh.icmph.un.echo.id = inet->inet_sport; |
| 165 | pfh.icmph.un.echo.sequence = user_icmph.icmp6_sequence; | 165 | pfh.icmph.un.echo.sequence = user_icmph.icmp6_sequence; |
| 166 | /* XXX: stripping const */ | 166 | pfh.msg = msg; |
| 167 | pfh.iov = (struct iovec *)msg->msg_iter.iov; | ||
| 168 | pfh.wcheck = 0; | 167 | pfh.wcheck = 0; |
| 169 | pfh.family = AF_INET6; | 168 | pfh.family = AF_INET6; |
| 170 | 169 | ||
