diff mbox series

[1/3] linux-user: Fix the build on systems without SOL_ALG

Message ID 20230810215706.1394220-2-iii@linux.ibm.com
State New
Headers show
Series Fix the build on CentOS 7 | expand

Commit Message

Ilya Leoshkevich Aug. 10, 2023, 9:51 p.m. UTC
Building QEMU on CentOS 7 fails, because there SOL_ALG is not defined.
There already exists #if defined(SOL_ALG) in do_setsockopt(); add it to
target_to_host_cmsg() as well.

Fixes: 27404b6c15c1 ("linux-user: Implement SOL_ALG encryption support")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 linux-user/syscall.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philippe Mathieu-Daudé Aug. 11, 2023, 2:11 p.m. UTC | #1
On 10/8/23 23:51, Ilya Leoshkevich wrote:
> Building QEMU on CentOS 7 fails, because there SOL_ALG is not defined.
> There already exists #if defined(SOL_ALG) in do_setsockopt(); add it to
> target_to_host_cmsg() as well.

Does including "crypto/afalgpriv.h" help?

> Fixes: 27404b6c15c1 ("linux-user: Implement SOL_ALG encryption support")
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>   linux-user/syscall.c | 2 ++
>   1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 18d3107194b..42f4aed8e84 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1806,6 +1806,7 @@  static inline abi_long target_to_host_cmsg(struct msghdr *msgh,
             __get_user(cred->pid, &target_cred->pid);
             __get_user(cred->uid, &target_cred->uid);
             __get_user(cred->gid, &target_cred->gid);
+#ifdef SOL_ALG
         } else if (cmsg->cmsg_level == SOL_ALG) {
             uint32_t *dst = (uint32_t *)data;
 
@@ -1814,6 +1815,7 @@  static inline abi_long target_to_host_cmsg(struct msghdr *msgh,
             if (len >= sizeof(uint32_t)) {
                 *dst = tswap32(*dst);
             }
+#endif
         } else {
             qemu_log_mask(LOG_UNIMP, "Unsupported ancillary data: %d/%d\n",
                           cmsg->cmsg_level, cmsg->cmsg_type);