]> git.proxmox.com Git - mirror_qemu.git/commitdiff
linux-user: add some IPV6 commands in setsockop()
authorLaurent Vivier <laurent@vivier.eu>
Thu, 29 Aug 2013 23:46:43 +0000 (01:46 +0200)
committerRiku Voipio <riku.voipio@linaro.org>
Tue, 24 Sep 2013 07:47:07 +0000 (10:47 +0300)
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
linux-user/syscall.c

index 505031b80f646fa346e4bfa12be41db87c265f0c..7a093bab049052268d8237102a528a7e2a59cddf 100644 (file)
@@ -1315,6 +1315,26 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
             goto unimplemented;
         }
         break;
+    case SOL_IPV6:
+        switch (optname) {
+        case IPV6_MTU_DISCOVER:
+        case IPV6_MTU:
+        case IPV6_V6ONLY:
+        case IPV6_RECVPKTINFO:
+            val = 0;
+            if (optlen < sizeof(uint32_t)) {
+                return -TARGET_EINVAL;
+            }
+            if (get_user_u32(val, optval_addr)) {
+                return -TARGET_EFAULT;
+            }
+            ret = get_errno(setsockopt(sockfd, level, optname,
+                                       &val, sizeof(val)));
+            break;
+        default:
+            goto unimplemented;
+        }
+        break;
     case SOL_RAW:
         switch (optname) {
         case ICMP_FILTER: