* PATCH: mips64 bogus setsockopt translation
@ 2003-07-20 1:33 Keith M Wesolowski
0 siblings, 0 replies; only message in thread
From: Keith M Wesolowski @ 2003-07-20 1:33 UTC (permalink / raw)
To: ralf; +Cc: linux-mips
DaveM recently nuked this translation that breaks icmpv6 filters from
sparc64. We have a copy of it, and ours is surely just as wrong.
Here's a patch.
--- arch/mips64/kernel/linux32.c.orig 2003-07-19 18:30:24.167408364 -0700
+++ arch/mips64/kernel/linux32.c 2003-07-19 18:30:52.686564580 -0700
@@ -1511,42 +1511,12 @@
return ret;
}
-static int do_set_icmpv6_filter(int fd, int level, int optname,
- char *optval, int optlen)
-{
- struct icmp6_filter kfilter;
- mm_segment_t old_fs;
- int ret, i;
-
- if (copy_from_user(&kfilter, optval, sizeof(kfilter)))
- return -EFAULT;
-
-
- for (i = 0; i < 8; i += 2) {
- u32 tmp = kfilter.data[i];
-
- kfilter.data[i] = kfilter.data[i + 1];
- kfilter.data[i + 1] = tmp;
- }
-
- old_fs = get_fs();
- set_fs(KERNEL_DS);
- ret = sys_setsockopt(fd, level, optname,
- (char *) &kfilter, sizeof(kfilter));
- set_fs(old_fs);
-
- return ret;
-}
-
asmlinkage int sys32_setsockopt(int fd, int level, int optname,
char *optval, int optlen)
{
if (optname == SO_ATTACH_FILTER)
return do_set_attach_filter(fd, level, optname,
optval, optlen);
- if (level == SOL_ICMPV6 && optname == ICMPV6_FILTER)
- return do_set_icmpv6_filter(fd, level, optname,
- optval, optlen);
return sys_setsockopt(fd, level, optname, optval, optlen);
}
--
Keith M Wesolowski <wesolows@foobazco.org> http://foobazco.org/~wesolows
------(( Project Foobazco Coordinator and Network Administrator ))------
"May Buddha bless all stubborn people!"
-- Uliassutai Karakorum Blake
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-07-20 1:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-20 1:33 PATCH: mips64 bogus setsockopt translation Keith M Wesolowski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.