qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 1/3] linux-user: pass sockaddr from host to target
@ 2012-07-16 10:13 Jing Huang
  2012-07-16 14:29 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Jing Huang @ 2012-07-16 10:13 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, riku.voipio, jing.huang.pku

This patch pass sockaddr from host to target.

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

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 539af3f..28c8ba5 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1873,8 +1873,16 @@ 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 = msg.msg_namelen;
+                ret = host_to_target_sockaddr(tswapal(msgp->msg_name),
+                                    msg.msg_name, msg.msg_namelen);
+                if (ret) {
+                    qemu_log("Failed to pass sockaddr to target guest");
+                    return ret;
+                }
                 ret = len;
+            }
         }
     }
     unlock_iovec(vec, target_vec, count, !send);
-- 
1.7.8.6

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

end of thread, other threads:[~2012-07-16 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-16 10:13 [Qemu-devel] [PATCH v2 1/3] linux-user: pass sockaddr from host to target Jing Huang
2012-07-16 14:29 ` 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).