aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2009-04-19 21:26:11 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-21 08:42:46 -0400
commit6f26c9a7555e5bcca3560919db9b852015077dae (patch)
tree9ca7509cd0cbbdae158b752c234cb23add8370f0 /include
parent43b39dcdbdf823a1c0ac1f2aa2d76bd2f210adc8 (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 'include')
-rw-r--r--include/linux/skbuff.h3
-rw-r--r--include/linux/socket.h4
2 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index af2b21bdda83..1b5c3d298f43 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1715,7 +1715,8 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
1715 struct iovec *iov); 1715 struct iovec *iov);
1716extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, 1716extern int skb_copy_datagram_from_iovec(struct sk_buff *skb,
1717 int offset, 1717 int offset,
1718 struct iovec *from, 1718 const struct iovec *from,
1719 int from_offset,
1719 int len); 1720 int len);
1720extern int skb_copy_datagram_const_iovec(const struct sk_buff *from, 1721extern int skb_copy_datagram_const_iovec(const struct sk_buff *from,
1721 int offset, 1722 int offset,
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 171b08db9c4f..42a0396f2c59 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -309,8 +309,8 @@ struct ucred {
309 309
310#ifdef __KERNEL__ 310#ifdef __KERNEL__
311extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); 311extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
312extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, 312extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
313 int offset, int len); 313 int offset, int len);
314extern int csum_partial_copy_fromiovecend(unsigned char *kdata, 314extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
315 struct iovec *iov, 315 struct iovec *iov,
316 int offset, 316 int offset,