* [Qemu-devel] [PATCH] linux-user: Added IP_(UN)BLOCK_SOURCE/IP_(ADD|DROP)_SOURCE_MEMBERSHIP flags to setsockopt
@ 2009-04-25 21:31 Lionel Landwerlin
0 siblings, 0 replies; only message in thread
From: Lionel Landwerlin @ 2009-04-25 21:31 UTC (permalink / raw)
To: qemu-devel
linux-user: Added IP_(UN)BLOCK_SOURCE/IP_(ADD|DROP)_SOURCE_MEMBERSHIP flags to setsockopt
Signed-off-by: Lionel Landwerlin <lionel.landwerlin@openwide.fr>
---
linux-user/syscall.c | 13 +++++++++++++
linux-user/syscall_defs.h | 7 +++++++
2 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 42f1089..898c962 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1138,6 +1138,7 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
abi_long ret;
int val;
struct ip_mreqn *ip_mreq;
+ struct ip_mreq_source *ip_mreq_source;
switch(level) {
case SOL_TCP:
@@ -1187,6 +1188,18 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
ret = get_errno(setsockopt(sockfd, level, optname, ip_mreq, optlen));
break;
+ case IP_BLOCK_SOURCE:
+ case IP_UNBLOCK_SOURCE:
+ case IP_ADD_SOURCE_MEMBERSHIP:
+ case IP_DROP_SOURCE_MEMBERSHIP:
+ if (optlen != sizeof (struct target_ip_mreq_source))
+ return -TARGET_EINVAL;
+
+ ip_mreq_source = lock_user(VERIFY_READ, optval_addr, optlen, 1);
+ ret = get_errno(setsockopt(sockfd, level, optname, ip_mreq_source, optlen));
+ unlock_user (ip_mreq_source, optval_addr, 0);
+ break;
+
default:
goto unimplemented;
}
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 3284710..f940d16 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -119,6 +119,13 @@ struct target_ip_mreqn {
abi_long imr_ifindex;
};
+struct target_ip_mreq_source {
+ /* big endian */
+ uint32_t imr_multiaddr;
+ uint32_t imr_interface;
+ uint32_t imr_sourceaddr;
+};
+
struct target_timeval {
abi_long tv_sec;
abi_long tv_usec;
--
1.6.2.4
--
Lionel Landwerlin <lionel.landwerlin@openwide.fr>
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-25 21:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-25 21:31 [Qemu-devel] [PATCH] linux-user: Added IP_(UN)BLOCK_SOURCE/IP_(ADD|DROP)_SOURCE_MEMBERSHIP flags to setsockopt Lionel Landwerlin
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).