diff mbox series

[v3,3/4] linux-user: add missing IPv6 get/setsockopt option

Message ID 20201218193213.3566856-4-scw@google.com (mailing list archive)
State New, archived
Headers show
Series fcntl and sockopt options | expand

Commit Message

Shu-Chun Weng Dec. 18, 2020, 7:32 p.m. UTC
IPV6_ADDR_PREFERENCES (RFC5014: Source address selection) was not supported.

Signed-off-by: Shu-Chun Weng <scw@google.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
---
v1 -> v2:
  Split out IPV6 options into own patch.
  do_print_sockopt() changes added in a separate patch since a large number of
  unrelated changes are involved.

v2 -> v3:
  Rebase to master on Dec 18, 2020

 linux-user/syscall.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8576ad24b7..cac4ec3b5a 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -51,6 +51,7 @@ 
 #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>
@@ -2265,6 +2266,7 @@  static abi_long do_setsockopt(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
@@ -2919,6 +2921,7 @@  get_timeout:
         case IPV6_RECVDSTOPTS:
         case IPV6_2292DSTOPTS:
         case IPV6_TCLASS:
+        case IPV6_ADDR_PREFERENCES:
 #ifdef IPV6_RECVPATHMTU
         case IPV6_RECVPATHMTU:
 #endif