patch-2.4.4 linux/net/core/iovec.c
Next file: linux/net/core/netfilter.c
Previous file: linux/net/core/filter.c
Back to the patch index
Back to the overall index
- Lines: 49
- Date:
Thu Apr 12 12:11:39 2001
- Orig file:
v2.4.3/linux/net/core/iovec.c
- Orig date:
Fri Feb 9 11:29:44 2001
diff -u --recursive --new-file v2.4.3/linux/net/core/iovec.c linux/net/core/iovec.c
@@ -102,48 +102,6 @@
return err;
}
-/* Copy and checkum skb to user iovec. Caller _must_ check that
- skb will fit to this iovec.
-
- Returns: 0 - success.
- -EINVAL - checksum failure.
- -EFAULT - fault during copy. Beware, in this case iovec can be
- modified!
- */
-
-int copy_and_csum_toiovec(struct iovec *iov, struct sk_buff *skb, int hlen)
-{
- unsigned int csum;
- int chunk = skb->len - hlen;
-
- /* Skip filled elements. Pretty silly, look at memcpy_toiovec, though 8) */
- while (iov->iov_len == 0)
- iov++;
-
- if (iov->iov_len < chunk) {
- if ((unsigned short)csum_fold(csum_partial(skb->h.raw, chunk+hlen, skb->csum)))
- goto csum_error;
- if (memcpy_toiovec(iov, skb->h.raw + hlen, chunk))
- goto fault;
- } else {
- int err = 0;
- csum = csum_partial(skb->h.raw, hlen, skb->csum);
- csum = csum_and_copy_to_user(skb->h.raw+hlen, iov->iov_base,
- chunk, csum, &err);
- if (err || ((unsigned short)csum_fold(csum)))
- goto csum_error;
- iov->iov_len -= chunk;
- iov->iov_base += chunk;
- }
- return 0;
-
-csum_error:
- return -EINVAL;
-
-fault:
- return -EFAULT;
-}
-
/*
* In kernel copy to iovec. Returns -EFAULT on error.
*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)