qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Shu-Chun Weng via Qemu-devel <qemu-devel@nongnu.org>
To: Laurent Vivier <laurent@vivier.eu>
Cc: Riku Voipio <riku.voipio@iki.fi>,
	qemu-devel@nongnu.org, Shu-Chun Weng <scw@google.com>
Subject: [Qemu-devel] [PATCH 1/2] linux-user: add missing UDP and IPv6 setsockopt options
Date: Thu, 22 Aug 2019 16:14:42 -0700	[thread overview]
Message-ID: <20190822231443.172099-2-scw@google.com> (raw)
In-Reply-To: <20190822231443.172099-1-scw@google.com>

UDP: SOL_UDP manipulate options at UDP level. All six options currently
defined in linux source include/uapi/linux/udp.h take integer values.

IPv6: IPV6_ADDR_PREFERENCES (RFC5014: Source address selection) was not
supported.

Signed-off-by: Shu-Chun Weng <scw@google.com>
---
 linux-user/syscall.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8367cb138d..8dc4255f12 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -49,8 +49,10 @@
 #include <sys/sysinfo.h>
 #include <sys/signalfd.h>
 //#include <sys/user.h>
+#include <netinet/in.h>
 #include <netinet/ip.h>
 #include <netinet/tcp.h>
+#include <netinet/udp.h>
 #include <linux/wireless.h>
 #include <linux/icmp.h>
 #include <linux/icmpv6.h>
@@ -1837,7 +1839,8 @@ static abi_long do_setsockopt(int sockfd, int level, int optname,
 
     switch(level) {
     case SOL_TCP:
-        /* TCP options all take an 'int' value.  */
+    case SOL_UDP:
+        /* TCP and UDP options all take an 'int' value.  */
         if (optlen < sizeof(uint32_t))
             return -TARGET_EINVAL;
 
@@ -2488,6 +2491,7 @@ static abi_long do_getsockopt(int sockfd, int level, int optname,
         case IPV6_RECVDSTOPTS:
         case IPV6_2292DSTOPTS:
         case IPV6_TCLASS:
+        case IPV6_ADDR_PREFERENCES:
 #ifdef IPV6_RECVPATHMTU
         case IPV6_RECVPATHMTU:
 #endif
-- 
2.23.0.187.g17f5b7556c-goog



  reply	other threads:[~2019-08-22 23:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-22 23:14 [Qemu-devel] [PATCH 0/2] Adding some setsockopt() options Shu-Chun Weng via Qemu-devel
2019-08-22 23:14 ` Shu-Chun Weng via Qemu-devel [this message]
2019-09-07 14:10   ` [Qemu-devel] [PATCH 1/2] linux-user: add missing UDP and IPv6 setsockopt options Laurent Vivier
2019-08-22 23:14 ` [Qemu-devel] [PATCH 2/2] linux-user: time stamping options for setsockopt() Shu-Chun Weng via Qemu-devel
2019-09-07 14:26   ` Laurent Vivier
2019-08-22 23:47 ` [Qemu-devel] [PATCH 0/2] Adding some setsockopt() options no-reply
2019-08-23 10:04 ` Aleksandar Markovic
2019-09-06 18:53 ` Shu-Chun Weng via Qemu-devel
2019-09-06 18:56   ` mailer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190822231443.172099-2-scw@google.com \
    --to=qemu-devel@nongnu.org \
    --cc=laurent@vivier.eu \
    --cc=riku.voipio@iki.fi \
    --cc=scw@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).