linux-user: add TARGET_SO_{DOMAIN,PROTOCOL}
PATCH 1/1 linux-user: add TARGET_SO_{DOMAIN,PROTOCOL}
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.
--- linux-user/generic/sockbits.h | 3 +++ linux-user/mips/sockbits.h | 2 ++ linux-user/syscall.c | 6 ++++++ 3 files changed, 11 insertions(+)
linux-user/generic/sockbits.h +3 -0
@@ -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
linux-user/mips/sockbits.h +2 -0
@@ -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
linux-user/syscall.c +6 -0
@@ -2832,6 +2832,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; }
Signature · 1 line
2.30.0
Le 04/02/2021 à 16:39, Jason A. Donenfeld a écrit :
Quoted 44 lines
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 <[email protected]>--- linux-user/generic/sockbits.h | 3 +++ linux-user/mips/sockbits.h | 2 ++ linux-user/syscall.c | 6 ++++++ 3 files changed, 11 insertions(+)linux-user/generic/sockbits.h +3
-0@@ -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 linux-user/mips/sockbits.h +2
-0@@ -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 11linux-user/syscall.c +0
-0@@ -2832,6 +2832,12 @@ get_timeout:case TARGET_SO_ACCEPTCONN : optname =SO_ACCEPTCONN ;
linux-user/syscall.c get_timeout: · line 2843
Quoted 10 lines
linux-user/syscall.c +6
-0goto 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; }
Laurent Vivier
AppliedLe 04/02/2021 à 16:39, Jason A. Donenfeld a écrit :
Quoted 44 lines
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 <[email protected]>--- linux-user/generic/sockbits.h | 3 +++ linux-user/mips/sockbits.h | 2 ++ linux-user/syscall.c | 6 ++++++ 3 files changed, 11 insertions(+)linux-user/generic/sockbits.h +3
-0@@ -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 linux-user/mips/sockbits.h +2
-0@@ -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 11linux-user/syscall.c +0
-0@@ -2832,6 +2832,12 @@ get_timeout:case TARGET_SO_ACCEPTCONN : optname =SO_ACCEPTCONN ;
linux-user/syscall.c get_timeout: · line 2843
Quoted 10 lines
linux-user/syscall.c +6
-0goto 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; }
Applied to my linux-user-for-6.0 branch.
Thanks,
Laurent