switch AF_PACKET and AF_UNIX to skb_copy_datagram_from_iter()
... and kill skb_copy_datagram_iovec()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 108d7f3..dfb148e 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -2408,6 +2408,10 @@
unsigned short gso_type = 0;
int hlen, tlen;
int extra_len = 0;
+ struct iov_iter from;
+ ssize_t n;
+
+ iov_iter_init(&from, WRITE, msg->msg_iov, msg->msg_iovlen, len);
/*
* Get and verify the address.
@@ -2446,8 +2450,9 @@
len -= vnet_hdr_len;
- err = memcpy_from_msg((void *)&vnet_hdr, msg, vnet_hdr_len);
- if (err < 0)
+ err = -EFAULT;
+ n = copy_from_iter(&vnet_hdr, vnet_hdr_len, &from);
+ if (n != vnet_hdr_len)
goto out_unlock;
if ((vnet_hdr.flags & VIRTIO_NET_HDR_F_NEEDS_CSUM) &&
@@ -2517,7 +2522,7 @@
}
/* Returns -EFAULT on error */
- err = skb_copy_datagram_from_iovec(skb, offset, msg->msg_iov, 0, len);
+ err = skb_copy_datagram_from_iter(skb, offset, &from, len);
if (err)
goto out_free;