From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199702272104.PAA00130@atheist.tamu.edu> Date: Thu, 27 Feb 1997 15:04:31 -0600 (CST) From: Richard Henderson Subject: retry 2.1.26 csum patch Bother. It seems the csum_partial_from_user patch for 2.1.26 got lost for 2.1.27. r~ --- linux-2.1.27/arch/alpha/lib/csum_partial_copy.c.orig Thu Feb 27 14:22:33 1997 +++ linux-2.1.27/arch/alpha/lib/csum_partial_copy.c Thu Feb 27 14:26:37 1997 @@ -304,20 +304,14 @@ csum_partial_cfu_unaligned(unsigned long return checksum; } -unsigned int -csum_partial_copy_from_user(int *errp, char *src, char *dst, - int len, unsigned int sum) +static unsigned int +do_csum_partial_copy_from_user(char *src, char *dst, int len, + unsigned int sum, int *errp) { unsigned long checksum = (unsigned) sum; unsigned long soff = 7 & (unsigned long) src; unsigned long doff = 7 & (unsigned long) dst; - if (!access_ok(src, len, VERIFY_READ)) { - *errp = -EFAULT; - memset(dst, 0, len); - return checksum; - } - if (len) { if (!doff) { if (!soff) @@ -358,12 +352,25 @@ csum_partial_copy_from_user(int *errp, c } unsigned int +csum_partial_copy_from_user(char *src, char *dst, int len, + unsigned int sum, int *errp) +{ + if (!access_ok(src, len, VERIFY_READ)) { + *errp = -EFAULT; + memset(dst, 0, len); + return sum; + } + + return do_csum_partial_copy_from_user(src, dst, len, sum, errp); +} + +unsigned int csum_partial_copy (const char *src, char *dst, int len, unsigned int sum) { unsigned int ret; int error = 0; - ret = csum_partial_copy_from_user(&error, src, dst, len, sum); + ret = do_csum_partial_copy_from_user(src, dst, len, sum, &error); if (error) printk("csum_partial_copy_old(): tell mingo to convert me!\n"); --- linux-2.1.27/include/asm-alpha/checksum.h.orig Thu Feb 27 14:26:55 1997 +++ linux-2.1.27/include/asm-alpha/checksum.h Thu Feb 27 14:27:38 1997 @@ -53,7 +53,7 @@ unsigned int csum_partial_copy(const cha * this is a new version of the above that records errors it finds in *errp, * but continues and zeros the rest of the buffer. */ -unsigned int csum_partial_copy_from_user(int *errp, char *src, char *dst, int len, unsigned int sum); +unsigned int csum_partial_copy_from_user(char *src, char *dst, int len, unsigned int sum, int *errp); /* * this routine is used for miscellaneous IP-like checksums, mainly -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com