[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/10] linux-user: make do_setsockopt support SOL_RA
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PATCH 05/10] linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket option |
Date: |
Tue, 14 Aug 2012 10:40:31 +0100 |
From: Jing Huang <address@hidden>
Signed-off-by: Jing Huang <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
linux-user/syscall.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 47f0eb3..700163e 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -60,6 +60,7 @@ int __clone2(int (*fn)(void *), void *child_stack_base,
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <linux/wireless.h>
+#include <linux/icmp.h>
#include "qemu-common.h"
#ifdef TARGET_GPROF
#include <sys/gmon.h>
@@ -1452,6 +1453,25 @@ static abi_long do_setsockopt(int sockfd, int level, int
optname,
goto unimplemented;
}
break;
+ case SOL_RAW:
+ switch (optname) {
+ case ICMP_FILTER:
+ /* struct icmp_filter takes an u32 value */
+ if (optlen < sizeof(uint32_t)) {
+ return -TARGET_EINVAL;
+ }
+
+ if (get_user_u32(val, optval_addr)) {
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(setsockopt(sockfd, level, optname,
+ &val, sizeof(val)));
+ break;
+
+ default:
+ goto unimplemented;
+ }
+ break;
case TARGET_SOL_SOCKET:
switch (optname) {
/* Options with 'int' argument. */
--
1.7.9.5
- [Qemu-devel] [PATCH 06/10] linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_type, (continued)
- [Qemu-devel] [PATCH 06/10] linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_type, Peter Maydell, 2012/08/14
- [Qemu-devel] [PATCH 09/10] linux-user: Use init_guest_space when -R and -B are specified, Peter Maydell, 2012/08/14
- [Qemu-devel] [PATCH 08/10] linux-user: Factor out guest space probing into a function, Peter Maydell, 2012/08/14
- [Qemu-devel] [PATCH 02/10] linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitions, Peter Maydell, 2012/08/14
- [Qemu-devel] [PATCH 07/10] flatload: fix bss clearing, Peter Maydell, 2012/08/14
- [Qemu-devel] [PATCH 03/10] linux-user: Move target_to_host_errno_table[] setup out of ioctl loop, Peter Maydell, 2012/08/14
[Qemu-devel] [PATCH 05/10] linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket option,
Peter Maydell <=
[Qemu-devel] [PATCH 04/10] linux-user: pass sockaddr from host to target, Peter Maydell, 2012/08/14
Re: [Qemu-devel] [PULL for-1.2 00/10] linux-user queue, Blue Swirl, 2012/08/14