* [PATCH] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL}
@ 2021-02-04 15:39 Jason A. Donenfeld
2021-02-13 19:29 ` Laurent Vivier
2021-02-13 19:30 ` Laurent Vivier
0 siblings, 2 replies; 3+ messages in thread
From: Jason A. Donenfeld @ 2021-02-04 15:39 UTC (permalink / raw)
To: qemu-devel; +Cc: Jason A. Donenfeld
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>
---
linux-user/generic/sockbits.h | 3 +++
linux-user/mips/sockbits.h | 2 ++
linux-user/syscall.c | 6 ++++++
3 files changed, 11 insertions(+)
diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h
index e44733c601..b3b4a8e44c 100644
--- a/linux-user/generic/sockbits.h
+++ b/linux-user/generic/sockbits.h
@@ -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
diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h
index 0f022cd598..562cad88e2 100644
--- a/linux-user/mips/sockbits.h
+++ b/linux-user/mips/sockbits.h
@@ -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
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 34760779c8..264b3265b1 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -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;
}
--
2.30.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL}
2021-02-04 15:39 [PATCH] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL} Jason A. Donenfeld
@ 2021-02-13 19:29 ` Laurent Vivier
2021-02-13 19:30 ` Laurent Vivier
1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2021-02-13 19:29 UTC (permalink / raw)
To: Jason A. Donenfeld, qemu-devel
Le 04/02/2021 à 16:39, Jason A. Donenfeld a écrit :
> 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>
> ---
> linux-user/generic/sockbits.h | 3 +++
> linux-user/mips/sockbits.h | 2 ++
> linux-user/syscall.c | 6 ++++++
> 3 files changed, 11 insertions(+)
>
> diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h
> index e44733c601..b3b4a8e44c 100644
> --- a/linux-user/generic/sockbits.h
> +++ b/linux-user/generic/sockbits.h
> @@ -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
> diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h
> index 0f022cd598..562cad88e2 100644
> --- a/linux-user/mips/sockbits.h
> +++ b/linux-user/mips/sockbits.h
> @@ -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
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 34760779c8..264b3265b1 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -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;
> }
>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL}
2021-02-04 15:39 [PATCH] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL} Jason A. Donenfeld
2021-02-13 19:29 ` Laurent Vivier
@ 2021-02-13 19:30 ` Laurent Vivier
1 sibling, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2021-02-13 19:30 UTC (permalink / raw)
To: Jason A. Donenfeld, qemu-devel
Le 04/02/2021 à 16:39, Jason A. Donenfeld a écrit :
> 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>
> ---
> linux-user/generic/sockbits.h | 3 +++
> linux-user/mips/sockbits.h | 2 ++
> linux-user/syscall.c | 6 ++++++
> 3 files changed, 11 insertions(+)
>
> diff --git a/linux-user/generic/sockbits.h b/linux-user/generic/sockbits.h
> index e44733c601..b3b4a8e44c 100644
> --- a/linux-user/generic/sockbits.h
> +++ b/linux-user/generic/sockbits.h
> @@ -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
> diff --git a/linux-user/mips/sockbits.h b/linux-user/mips/sockbits.h
> index 0f022cd598..562cad88e2 100644
> --- a/linux-user/mips/sockbits.h
> +++ b/linux-user/mips/sockbits.h
> @@ -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
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index 34760779c8..264b3265b1 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -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;
> }
>
Applied to my linux-user-for-6.0 branch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-02-13 19:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-04 15:39 [PATCH] linux-user: add TARGET_SO_{DOMAIN,PROTOCOL} Jason A. Donenfeld
2021-02-13 19:29 ` Laurent Vivier
2021-02-13 19:30 ` Laurent Vivier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.