diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-24 10:42:55 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-09 16:29:03 -0500 |
commit | c0371da6047abd261bc483c744dbc7d81a116172 (patch) | |
tree | 73b4d685f311a83e04f3a684ce18225b409b3f5f /net/ipv4 | |
parent | d838df2e5dcbb6ed4d82854869e9a30f9aeef6da (diff) |
put iov_iter into msghdr
Note that the code _using_ ->msg_iter at that point will be very
unhappy with anything other than unshifted iovec-backed iov_iter.
We still need to convert users to proper primitives.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ip_output.c | 6 | ||||
-rw-r--r-- | net/ipv4/ping.c | 3 | ||||
-rw-r--r-- | net/ipv4/raw.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 6 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 2 |
5 files changed, 12 insertions, 8 deletions
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index cdedcf144463..b50861b22b6b 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -755,11 +755,13 @@ ip_generic_getfrag(void *from, char *to, int offset, int len, int odd, struct sk | |||
755 | struct msghdr *msg = from; | 755 | struct msghdr *msg = from; |
756 | 756 | ||
757 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | 757 | if (skb->ip_summed == CHECKSUM_PARTIAL) { |
758 | if (memcpy_fromiovecend(to, msg->msg_iov, offset, len) < 0) | 758 | /* XXX: stripping const */ |
759 | if (memcpy_fromiovecend(to, (struct iovec *)msg->msg_iter.iov, offset, len) < 0) | ||
759 | return -EFAULT; | 760 | return -EFAULT; |
760 | } else { | 761 | } else { |
761 | __wsum csum = 0; | 762 | __wsum csum = 0; |
762 | if (csum_partial_copy_fromiovecend(to, msg->msg_iov, offset, len, &csum) < 0) | 763 | /* XXX: stripping const */ |
764 | if (csum_partial_copy_fromiovecend(to, (struct iovec *)msg->msg_iter.iov, offset, len, &csum) < 0) | ||
763 | return -EFAULT; | 765 | return -EFAULT; |
764 | skb->csum = csum_block_add(skb->csum, csum, odd); | 766 | skb->csum = csum_block_add(skb->csum, csum, odd); |
765 | } | 767 | } |
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index 8dd4ae0424fc..c0d82f78d364 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c | |||
@@ -811,7 +811,8 @@ 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 | pfh.iov = msg->msg_iov; | 814 | /* XXX: stripping const */ |
815 | pfh.iov = (struct iovec *)msg->msg_iter.iov; | ||
815 | pfh.wcheck = 0; | 816 | pfh.wcheck = 0; |
816 | pfh.family = AF_INET; | 817 | pfh.family = AF_INET; |
817 | 818 | ||
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index 5d83bd2fcedb..0bb68df5055d 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -625,7 +625,8 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
625 | back_from_confirm: | 625 | back_from_confirm: |
626 | 626 | ||
627 | if (inet->hdrincl) | 627 | if (inet->hdrincl) |
628 | err = raw_send_hdrinc(sk, &fl4, msg->msg_iov, len, | 628 | /* XXX: stripping const */ |
629 | err = raw_send_hdrinc(sk, &fl4, (struct iovec *)msg->msg_iter.iov, len, | ||
629 | &rt, msg->msg_flags); | 630 | &rt, msg->msg_flags); |
630 | 631 | ||
631 | else { | 632 | else { |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 4a96f3730170..54ba6209eea9 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1085,7 +1085,7 @@ static int tcp_sendmsg_fastopen(struct sock *sk, struct msghdr *msg, | |||
1085 | int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 1085 | int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
1086 | size_t size) | 1086 | size_t size) |
1087 | { | 1087 | { |
1088 | struct iovec *iov; | 1088 | const struct iovec *iov; |
1089 | struct tcp_sock *tp = tcp_sk(sk); | 1089 | struct tcp_sock *tp = tcp_sk(sk); |
1090 | struct sk_buff *skb; | 1090 | struct sk_buff *skb; |
1091 | int iovlen, flags, err, copied = 0; | 1091 | int iovlen, flags, err, copied = 0; |
@@ -1136,8 +1136,8 @@ int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1136 | mss_now = tcp_send_mss(sk, &size_goal, flags); | 1136 | mss_now = tcp_send_mss(sk, &size_goal, flags); |
1137 | 1137 | ||
1138 | /* Ok commence sending. */ | 1138 | /* Ok commence sending. */ |
1139 | iovlen = msg->msg_iovlen; | 1139 | iovlen = msg->msg_iter.nr_segs; |
1140 | iov = msg->msg_iov; | 1140 | iov = msg->msg_iter.iov; |
1141 | copied = 0; | 1141 | copied = 0; |
1142 | 1142 | ||
1143 | err = -EPIPE; | 1143 | err = -EPIPE; |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index f5bd4bd3f7e6..3e225b03eb95 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -3050,7 +3050,7 @@ static int tcp_send_syn_data(struct sock *sk, struct sk_buff *syn) | |||
3050 | syn_data->ip_summed = CHECKSUM_PARTIAL; | 3050 | syn_data->ip_summed = CHECKSUM_PARTIAL; |
3051 | memcpy(syn_data->cb, syn->cb, sizeof(syn->cb)); | 3051 | memcpy(syn_data->cb, syn->cb, sizeof(syn->cb)); |
3052 | if (unlikely(memcpy_fromiovecend(skb_put(syn_data, space), | 3052 | if (unlikely(memcpy_fromiovecend(skb_put(syn_data, space), |
3053 | fo->data->msg_iov, 0, space))) { | 3053 | fo->data->msg_iter.iov, 0, space))) { |
3054 | kfree_skb(syn_data); | 3054 | kfree_skb(syn_data); |
3055 | goto fallback; | 3055 | goto fallback; |
3056 | } | 3056 | } |