summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/sockopt.c
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2008-08-01 13:46:08 +0000
committerXavier Leroy <xavier.leroy@inria.fr>2008-08-01 13:46:08 +0000
commitb4d335cb9fc40572efd2414347e586c8590feb4e (patch)
treee11784d760c918612ca597ab217ffecf7f112aec /otherlibs/win32unix/sockopt.c
parent7ae8be59fa3a47a3fae0b306bafdb4b13881d7c0 (diff)
PR#4536: Add socket option IPV6_V6ONLY
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8968 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/win32unix/sockopt.c')
-rw-r--r--otherlibs/win32unix/sockopt.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/otherlibs/win32unix/sockopt.c b/otherlibs/win32unix/sockopt.c
index 5fab2f6ff..f82d810e6 100644
--- a/otherlibs/win32unix/sockopt.c
+++ b/otherlibs/win32unix/sockopt.c
@@ -21,6 +21,13 @@
#include "unixsupport.h"
#include "socketaddr.h"
+#ifndef IPPROTO_IPV6
+#define IPPROTO_IPV6 (-1)
+#endif
+#ifndef IPV6_V6ONLY
+#define IPV6_V6ONLY (-1)
+#endif
+
enum option_type {
TYPE_BOOL = 0,
TYPE_INT = 1,
@@ -44,7 +51,8 @@ static struct socket_option sockopt_bool[] = {
{ SOL_SOCKET, SO_DONTROUTE },
{ SOL_SOCKET, SO_OOBINLINE },
{ SOL_SOCKET, SO_ACCEPTCONN },
- { IPPROTO_TCP, TCP_NODELAY }
+ { IPPROTO_TCP, TCP_NODELAY },
+ { IPPROTO_IPV6, IPV6_V6ONLY}
};
static struct socket_option sockopt_int[] = {