qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH V3 1/3] linux-user: pass sockaddr from host to target
  2012-07-21  1:28 [Qemu-devel] [PATCH V3 1/3] linux-user: pass sockaddr from host to target Jing Huang
@ 2012-07-20 18:12 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2012-07-20 18:12 UTC (permalink / raw)
  To: Jing Huang; +Cc: riku.voipio, qemu-devel

On 21 July 2012 02:28, Jing Huang <jing.huang.pku@gmail.com> wrote:
>
> Signed-off-by: Jing Huang <jing.huang.pku@gmail.com>

When you send v4 of this series please can you include in this
patch the deletion of the comment line
"/* ??? Should this also swap msgh->name?  */"
from just above target_to_host_cmsg().
(This patch does the swapping of msgh->name in the caller
and so it has dealt with this ??? question.)

If you make just that change you can add
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

to the commit message for this patch.

-- PMM

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Qemu-devel] [PATCH V3 1/3] linux-user: pass sockaddr from host to target
@ 2012-07-21  1:28 Jing Huang
  2012-07-20 18:12 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Jing Huang @ 2012-07-21  1:28 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, riku.voipio, jing.huang.pku


Signed-off-by: Jing Huang <jing.huang.pku@gmail.com>
---
 linux-user/syscall.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 539af3f..82aa83d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1873,10 +1873,21 @@ static abi_long do_sendrecvmsg(int fd, abi_ulong target_msg,
         if (!is_error(ret)) {
             len = ret;
             ret = host_to_target_cmsg(msgp, &msg);
-            if (!is_error(ret))
+            if (!is_error(ret)) {
+                msgp->msg_namelen = tswap32(msg.msg_namelen);
+                if (msg.msg_name != NULL) {
+                    ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
+                                    msg.msg_name, msg.msg_namelen);
+                    if (ret) {
+                        goto out;
+                    }
+                }
+
                 ret = len;
+            }
         }
     }
+out:
     unlock_iovec(vec, target_vec, count, !send);
     unlock_user_struct(msgp, target_msg, send ? 0 : 1);
     return ret;
-- 
1.7.8.6

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-20 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-21  1:28 [Qemu-devel] [PATCH V3 1/3] linux-user: pass sockaddr from host to target Jing Huang
2012-07-20 18:12 ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).