From: Peter Maydell <peter.maydell@linaro.org>
To: Anthony Liguori <aliguori@us.ibm.com>, Blue Swirl <blauwirbel@gmail.com>
Cc: Riku Voipio <riku.voipio@iki.fi>, qemu-devel@nongnu.org
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 [thread overview]
Message-ID: <1344937236-611-6-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1344937236-611-1-git-send-email-peter.maydell@linaro.org>
From: Jing Huang <jing.huang.pku@gmail.com>
Signed-off-by: Jing Huang <jing.huang.pku@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
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
next prev parent reply other threads:[~2012-08-14 9:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-14 9:40 [Qemu-devel] [PULL for-1.2 00/10] linux-user queue Peter Maydell
2012-08-14 9:40 ` [Qemu-devel] [PATCH 01/10] linux-user: Fix incorrect TARGET_BLKBSZGET, TARGET_BLKBSZSET Peter Maydell
2012-08-14 9:40 ` [Qemu-devel] [PATCH 02/10] linux-user: Fix SNDCTL_DSP_MAP{IN, OUT}BUF ioctl definitions Peter Maydell
2012-08-14 9:40 ` [Qemu-devel] [PATCH 03/10] linux-user: Move target_to_host_errno_table[] setup out of ioctl loop Peter Maydell
2012-08-14 18:27 ` Blue Swirl
2012-08-14 18:38 ` Peter Maydell
2012-08-14 18:58 ` Blue Swirl
2012-08-14 19:35 ` Peter Maydell
2012-08-14 9:40 ` [Qemu-devel] [PATCH 04/10] linux-user: pass sockaddr from host to target Peter Maydell
2012-08-14 9:40 ` Peter Maydell [this message]
2012-08-14 9:40 ` [Qemu-devel] [PATCH 06/10] linux-user: make host_to_target_cmsg support SO_TIMESTAMP cmsg_type Peter Maydell
2012-08-14 9:40 ` [Qemu-devel] [PATCH 07/10] flatload: fix bss clearing Peter Maydell
2012-08-14 9:40 ` [Qemu-devel] [PATCH 08/10] linux-user: Factor out guest space probing into a function Peter Maydell
2012-08-14 9:40 ` [Qemu-devel] [PATCH 09/10] linux-user: Use init_guest_space when -R and -B are specified Peter Maydell
2012-08-14 9:40 ` [Qemu-devel] [PATCH 10/10] linux-user: ARM: Ignore immediate value for svc in thumb mode Peter Maydell
2012-08-14 19:56 ` [Qemu-devel] [PULL for-1.2 00/10] linux-user queue Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1344937236-611-6-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=aliguori@us.ibm.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).