qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: Add missing IP_TOS, IPV6_TCLASS and IPV6_RECVTCLASS sockopts
@ 2017-03-11 19:59 Helge Deller
  0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2017-03-11 19:59 UTC (permalink / raw)
  To: qemu-devel, Riku Voipio; +Cc: Richard Henderson

When running the nslookup or dig command with IPv6, the following qemu
warnings will be shown:

Unsupported ancillary data: 0/1
Unsupported setsockopt level=41 optname=67
Unsupported setsockopt level=41 optname=66
Unsupported ancillary data: 41/67

This patch adds the missing code to quiet those warnings.

Signed-off-by: Helge Deller <deller@gmx.de>

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 03ed370..e5f55e9 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -1713,6 +1713,18 @@ static inline abi_long target_to_host_cmsg(struct msghdr *msgh,
             __get_user(cred->pid, &target_cred->pid);
             __get_user(cred->uid, &target_cred->uid);
             __get_user(cred->gid, &target_cred->gid);
+        } else if (cmsg->cmsg_level == SOL_IP
+               &&  cmsg->cmsg_type == IP_TOS) {
+            char *s = (char *)data;
+            char *t = (char *)target_data;
+
+            __get_user(*s, t);
+        } else if (cmsg->cmsg_level == SOL_IPV6
+               &&  cmsg->cmsg_type == IPV6_TCLASS) {
+            int32_t *s = (int32_t *)data;
+            int32_t *t = (int32_t *)target_data;
+
+            __get_user(*s, t);
         } else {
             gemu_log("Unsupported ancillary data: %d/%d\n",
                                         cmsg->cmsg_level, cmsg->cmsg_type);
@@ -1848,6 +1860,7 @@ static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh,
 
         case SOL_IP:
             switch (cmsg->cmsg_type) {
+            case IP_TOS:
             case IP_TTL:
             {
                 uint32_t *v = (uint32_t *)data;
@@ -2902,6 +2915,8 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
         case IPV6_RECVHOPLIMIT:
         case IPV6_2292HOPLIMIT:
         case IPV6_CHECKSUM:
+        case IPV6_RECVTCLASS:
+        case IPV6_TCLASS:
             val = 0;
             if (optlen < sizeof(uint32_t)) {
                 return -TARGET_EINVAL;

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-11 19:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-11 19:59 [Qemu-devel] [PATCH] linux-user: Add missing IP_TOS, IPV6_TCLASS and IPV6_RECVTCLASS sockopts Helge Deller

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).