diff options
author | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-06-14 17:55:54 +0000 |
---|---|---|
committer | Kanoj Sarcar <kanoj@engr.sgi.com> | 2000-06-14 17:55:54 +0000 |
commit | b0cb48abe83d1a4389ea938bf624f8baa82c5047 (patch) | |
tree | e8c0a51f5a78947e016950c79a581461374cc36a /arch | |
parent | 4873bd66f2e888c267340c1cdb273e455b26c292 (diff) |
One more 32bit call.
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips64/kernel/linux32.c | 44 | ||||
-rw-r--r-- | arch/mips64/kernel/scall_o32.S | 2 |
2 files changed, 45 insertions, 1 deletions
diff --git a/arch/mips64/kernel/linux32.c b/arch/mips64/kernel/linux32.c index a26631e3b..c4dba234b 100644 --- a/arch/mips64/kernel/linux32.c +++ b/arch/mips64/kernel/linux32.c @@ -18,6 +18,8 @@ #include <linux/time.h> #include <linux/poll.h> #include <linux/slab.h> +#include <linux/skbuff.h> +#include <linux/filter.h> #include <asm/uaccess.h> #include <asm/mman.h> @@ -1336,3 +1338,45 @@ asmlinkage long sys32_times(struct tms32 *tbuf) } return ret; } + +extern asmlinkage int sys_setsockopt(int fd, int level, int optname, + char *optval, int optlen); + +asmlinkage int sys32_setsockopt(int fd, int level, int optname, + char *optval, int optlen) +{ + if (optname == SO_ATTACH_FILTER) { + struct sock_fprog32 { + __u16 len; + __u32 filter; + } *fprog32 = (struct sock_fprog32 *)optval; + struct sock_fprog kfprog; + struct sock_filter *kfilter; + unsigned int fsize; + mm_segment_t old_fs; + __u32 uptr; + int ret; + + if (get_user(kfprog.len, &fprog32->len) || + __get_user(uptr, &fprog32->filter)) + return -EFAULT; + kfprog.filter = (struct sock_filter *)A(uptr); + fsize = kfprog.len * sizeof(struct sock_filter); + kfilter = (struct sock_filter *)kmalloc(fsize, GFP_KERNEL); + if (kfilter == NULL) + return -ENOMEM; + if (copy_from_user(kfilter, kfprog.filter, fsize)) { + kfree(kfilter); + return -EFAULT; + } + kfprog.filter = kfilter; + old_fs = get_fs(); + set_fs(KERNEL_DS); + ret = sys_setsockopt(fd, level, optname, + (char *)&kfprog, sizeof(kfprog)); + set_fs(old_fs); + kfree(kfilter); + return ret; + } + return sys_setsockopt(fd, level, optname, optval, optlen); +} diff --git a/arch/mips64/kernel/scall_o32.S b/arch/mips64/kernel/scall_o32.S index cd813a36d..2e22ac1d0 100644 --- a/arch/mips64/kernel/scall_o32.S +++ b/arch/mips64/kernel/scall_o32.S @@ -383,7 +383,7 @@ illegal_syscall: sys sys_send 4 sys sys_sendmsg 3 sys sys_sendto 6 /* 4180 */ - sys sys_setsockopt 5 + sys sys32_setsockopt 5 sys sys_shutdown 2 sys sys_socket 3 sys sys_socketpair 4 |