diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2009-04-19 21:26:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-21 08:42:46 -0400 |
commit | 6f26c9a7555e5bcca3560919db9b852015077dae (patch) | |
tree | 9ca7509cd0cbbdae158b752c234cb23add8370f0 /net/core/iovec.c | |
parent | 43b39dcdbdf823a1c0ac1f2aa2d76bd2f210adc8 (diff) |
tun: fix tun_chr_aio_write so that aio works
aio_write gets const struct iovec * but tun_chr_aio_write casts this to struct
iovec * and modifies the iovec. As a result, attempts to use io_submit
to send packets to a tun device fail with weird errors such as EINVAL.
Since tun is the only user of skb_copy_datagram_from_iovec, we can
fix this simply by changing the later so that it does not
touch the iovec passed to it.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/iovec.c')
-rw-r--r-- | net/core/iovec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/core/iovec.c b/net/core/iovec.c index a215545c0a34..40a76ce19d9f 100644 --- a/net/core/iovec.c +++ b/net/core/iovec.c | |||
@@ -147,10 +147,11 @@ int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len) | |||
147 | } | 147 | } |
148 | 148 | ||
149 | /* | 149 | /* |
150 | * For use with ip_build_xmit | 150 | * Copy iovec from kernel. Returns -EFAULT on error. |
151 | */ | 151 | */ |
152 | int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, int offset, | 152 | |
153 | int len) | 153 | int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, |
154 | int offset, int len) | ||
154 | { | 155 | { |
155 | /* Skip over the finished iovecs */ | 156 | /* Skip over the finished iovecs */ |
156 | while (offset >= iov->iov_len) { | 157 | while (offset >= iov->iov_len) { |