modified target_to_host_cmsg() and host_to_target_cmsg().

diff -Nurb qemu-20070623/linux-user/syscall.c qemu-loongson/linux-user/syscall.c
--- qemu-20070623/linux-user/syscall.c  2007-06-23 16:39:14.000000000 +0800
+++ qemu-loongson/linux-user/syscall.c  2007-06-23 21:49:18.000000000 +0800
@@ -562,10 +562,12 @@
         }
 
         cmsg->cmsg_level = tswap32(target_cmsg->cmsg_level);
+       if(cmsg->cmsg_level == TARGET_SOL_SOCKET)
+               cmsg->cmsg_level = SOL_SOCKET;
         cmsg->cmsg_type = tswap32(target_cmsg->cmsg_type);
         cmsg->cmsg_len = CMSG_LEN(len);
 
-        if (cmsg->cmsg_level != TARGET_SOL_SOCKET || cmsg->cmsg_type != 
SCM_RIGHTS) {
+        if (cmsg->cmsg_level != SOL_SOCKET || cmsg->cmsg_type != SCM_RIGHTS) {
             gemu_log("Unsupported ancillary data: %d/%d\n", cmsg->cmsg_level, 
cmsg->cmsg_type);
             memcpy(data, target_data, len);
         } else {
@@ -606,10 +608,12 @@
         }
 
         target_cmsg->cmsg_level = tswap32(cmsg->cmsg_level);
+       if(target_cmsg->cmsg_level == SOL_SOCKET)
+               target_cmsg->cmsg_level = TARGET_SOL_SOCKET;
         target_cmsg->cmsg_type = tswap32(cmsg->cmsg_type);
         target_cmsg->cmsg_len = tswapl(TARGET_CMSG_LEN(len));
 
-        if (cmsg->cmsg_level != TARGET_SOL_SOCKET || cmsg->cmsg_type != 
SCM_RIGHTS) {
+        if (target_cmsg->cmsg_level != TARGET_SOL_SOCKET || 
target_cmsg->cmsg_type != SCM_RIGHTS) {
             gemu_log("Unsupported ancillary data: %d/%d\n", cmsg->cmsg_level, 
cmsg->cmsg_type);
             memcpy(target_data, data, len);
         } else {

Reply via email to