Skip to contentSkip to conversation

linux-user: fix recvmsg emulation

PATCH Applied Andreas Schwab 3 participants 4 messages Feb 12, 2019 – Feb 14, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-user: fix recvmsg emulation

Set msg_flags in the returned struct msghdr.

---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)
linux-user/syscall.c +1 -0
index 90bfda3563..b6b566a6fa 100644
@@ -2797,6 +2797,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
             }
             if (!is_error(ret)) {
                 msgp->msg_namelen = tswap32(msg.msg_namelen);
+                msgp->msg_flags = tswap32(msg.msg_flags);
                 if (msg.msg_name != NULL && msg.msg_name != (void *)-1) {
                     ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
                                     msg.msg_name, msg.msg_namelen);
Signature · 7 lines
2.20.1


-- 
Andreas Schwab, SUSE Labs, [email protected]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Andreas Schwab

Set msg_flags in the returned struct msghdr.

---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)
linux-user/syscall.c +0 -0
index 90bfda3563..b6b566a6fa 100644

linux-user/syscall.c static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp, · line 2803

Quoted 7 lines
linux-user/syscall.c +1 -0
@@ -2797,6 +2797,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
             }
             if (!is_error(ret)) {
                 msgp->msg_namelen = tswap32(msg.msg_namelen);
+                msgp->msg_flags = tswap32(msg.msg_flags);
                 if (msg.msg_name != NULL && msg.msg_name != (void *)-1) {
                     ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
                                     msg.msg_name, msg.msg_namelen);
Reviewed-by on v1 1/1
#2 lore raw
In reply to Andreas Schwab
Quoted 3 lines · Andreas Schwab

Set msg_flags in the returned struct msghdr.

Quoted 17 lines
---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)
linux-user/syscall.c +1 -0
index 90bfda3563..b6b566a6fa 100644
@@ -2797,6 +2797,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
             }
             if (!is_error(ret)) {
                 msgp->msg_namelen = tswap32(msg.msg_namelen);
+                msgp->msg_flags = tswap32(msg.msg_flags);
                 if (msg.msg_name != NULL && msg.msg_name != (void *)-1) {
                     ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
                                     msg.msg_name, msg.msg_namelen);
#3 lore raw
In reply to Andreas Schwab
Quoted 13 lines · Andreas Schwab

Set msg_flags in the returned struct msghdr.

---
 linux-user/syscall.c | 1 +
 1 file changed, 1 insertion(+)
linux-user/syscall.c +0 -0
index 90bfda3563..b6b566a6fa 100644

linux-user/syscall.c static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp, · line 2803

Quoted 7 lines
linux-user/syscall.c +1 -0
@@ -2797,6 +2797,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
             }
             if (!is_error(ret)) {
                 msgp->msg_namelen = tswap32(msg.msg_namelen);
+                msgp->msg_flags = tswap32(msg.msg_flags);
                 if (msg.msg_name != NULL && msg.msg_name != (void *)-1) {
                     ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
                                     msg.msg_name, msg.msg_namelen);

Applied to my linux-user branch.

Thanks,
Laurent