linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket option
PATCH v4 2/3 linux-user: make do_setsockopt support SOL_RAW ICMP_FILTER socket option
Signed-off-by Jing Huang <[email protected]>
Reviewed-by Peter Maydell <[email protected]>
--- linux-user/syscall.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-)
linux-user/syscall.c +20 -0
@@ -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>
@@ -1441,6 +1442,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. */
Signature · 1 line
1.7.8.6