linux-user: add TARGET_SO_{DOMAIN,PROTOCOL}
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 4 Feb 2021 15:39:25 +0000 (16:39 +0100)
committerLaurent Vivier <laurent@vivier.eu>
Sat, 13 Feb 2021 21:50:50 +0000 (22:50 +0100)
These were defined for other platforms but mistakenly left out of mips
and generic, so this commit adds them to the places missing. Then it
makes them be translated in getsockopt.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210204153925.2030606-1-Jason@zx2c4.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
linux-user/generic/sockbits.h
linux-user/mips/sockbits.h
linux-user/syscall.c

index e44733c601a4b23418a7f67d9e0a5366f7a5c2e0..b3b4a8e44c6d524f560ba5bc9e7b630914d288f2 100644 (file)
@@ -55,4 +55,7 @@
 #define TARGET_SO_ACCEPTCONN           30
 
 #define TARGET_SO_PEERSEC              31
+
+#define TARGET_SO_PROTOCOL             38
+#define TARGET_SO_DOMAIN               39
 #endif
index 0f022cd598a905cbf9724d6ce8f8c33fb136e962..562cad88e2f8d75a1eed84c680c184750306251b 100644 (file)
@@ -40,6 +40,8 @@
 #define TARGET_SO_SNDTIMEO     0x1005  /* send timeout */
 #define TARGET_SO_RCVTIMEO     0x1006  /* receive timeout */
 #define TARGET_SO_ACCEPTCONN   0x1009
+#define TARGET_SO_PROTOCOL     0x1028  /* protocol type */
+#define TARGET_SO_DOMAIN       0x1029  /* domain/socket family */
 
 /* linux-specific, might as well be the same as on i386 */
 #define TARGET_SO_NO_CHECK     11
index 6fea00869e6b69a90870cf603e0fb50ded004afe..36b090105522eb468d7f7e9104a96b65d4eba196 100644 (file)
@@ -2837,6 +2837,12 @@ get_timeout:
         case TARGET_SO_ACCEPTCONN:
             optname = SO_ACCEPTCONN;
             goto int_case;
+        case TARGET_SO_PROTOCOL:
+            optname = SO_PROTOCOL;
+            goto int_case;
+        case TARGET_SO_DOMAIN:
+            optname = SO_DOMAIN;
+            goto int_case;
         default:
             goto int_case;
         }