summary refs log tree commit diff stats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorShu-Chun Weng <scw@google.com>2020-12-18 11:32:11 -0800
committerLaurent Vivier <laurent@vivier.eu>2021-01-20 18:21:03 +0100
commitfe51b0a5979e94fd1853996ea0613089f4528340 (patch)
treebc49c250449e356e4fddf958fd37ef47580ab3b0 /linux-user/syscall.c
parent2bb963ff6b99b39e1593be55e3b5d08a09121b6a (diff)
downloadfocaccia-qemu-fe51b0a5979e94fd1853996ea0613089f4528340.tar.gz
focaccia-qemu-fe51b0a5979e94fd1853996ea0613089f4528340.zip
linux-user: add missing UDP get/setsockopt option
SOL_UDP manipulate options at UDP level. All six options currently defined
in linux source include/uapi/linux/udp.h take integer values.

Signed-off-by: Shu-Chun Weng <scw@google.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20201218193213.3566856-3-scw@google.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Diffstat (limited to 'linux-user/syscall.c')
-rw-r--r--linux-user/syscall.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 98aaca0187..969db20081 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -53,6 +53,7 @@
 //#include <sys/user.h>
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
+#include <netinet/udp.h>
 #include <linux/wireless.h>
 #include <linux/icmp.h>
 #include <linux/icmpv6.h>
@@ -2184,7 +2185,8 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
 
     switch(level) {
     case SOL_TCP:
-        /* TCP options all take an 'int' value.  */
+    case SOL_UDP:
+        /* TCP and UDP options all take an 'int' value.  */
         if (optlen < sizeof(uint32_t))
             return -TARGET_EINVAL;
 
@@ -2832,7 +2834,8 @@ get_timeout:
         }
         break;
     case SOL_TCP:
-        /* TCP options all take an 'int' value.  */
+    case SOL_UDP:
+        /* TCP and UDP options all take an 'int' value.  */
     int_case:
         if (get_user_u32(len, optlen))
             return -TARGET_EFAULT;