]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
linux-user: Add support for SO_REUSEPORT
authorYunqiang Su <ysu@wavecomp.com>
Tue, 30 Oct 2018 12:55:08 +0000 (13:55 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Mon, 12 Nov 2018 15:38:26 +0000 (16:38 +0100)
Add support for SO_REUSEPORT, including strace support. SO_REUSEPORT
was introduced relatively recently, since Linux 3.9, so use
'#if defined SO_REUSEPORT'.

Signed-off-by: Yunqiang Su <ysu@wavecomp.com>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <1540904108-30873-4-git-send-email-aleksandar.markovic@rt-rk.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/strace.c
linux-user/syscall.c

index 33f4a506a21fd0399a95796a8f846c3039349608..d1d14945f9dc2c6e80e24d6ab0b8e0dc69280d97 100644 (file)
@@ -1742,6 +1742,9 @@ print_optint:
         case TARGET_SO_REUSEADDR:
             gemu_log("SO_REUSEADDR,");
             goto print_optint;
+        case TARGET_SO_REUSEPORT:
+            gemu_log("SO_REUSEPORT,");
+            goto print_optint;
         case TARGET_SO_TYPE:
             gemu_log("SO_TYPE,");
             goto print_optint;
index 810a58b70412839826e4b884ee07211379dbd3ac..5c166928a4da91304d2c5b8b058ff15cb71a8e3e 100644 (file)
@@ -2061,6 +2061,11 @@ set_timeout:
         case TARGET_SO_REUSEADDR:
                optname = SO_REUSEADDR;
                break;
+#ifdef SO_REUSEPORT
+        case TARGET_SO_REUSEPORT:
+                optname = SO_REUSEPORT;
+                break;
+#endif
         case TARGET_SO_TYPE:
                optname = SO_TYPE;
                break;
@@ -2222,6 +2227,11 @@ static abi_long do_getsockopt(int sockfd, int level, int optname,
         case TARGET_SO_REUSEADDR:
             optname = SO_REUSEADDR;
             goto int_case;
+#ifdef SO_REUSEPORT
+        case TARGET_SO_REUSEPORT:
+            optname = SO_REUSEPORT;
+            goto int_case;
+#endif
         case TARGET_SO_TYPE:
             optname = SO_TYPE;
             goto int_case;