Add Unix.SO_REUSEPORT (#9869)

Support the SO_REUSEPORT socket option.

Closes: #3512
master
Yishuai Li 2020-09-02 04:52:04 -04:00 committed by GitHub
parent 34f20c7746
commit 63c7071a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 0 deletions

View File

@ -219,6 +219,9 @@ Working version
- #9802: Ensure signals are handled before Unix.kill returns
(Stephen Dolan, review by Jacques-Henri Jourdan)
- #9869: Add Unix.SO_REUSEPORT
(Yishuai Li, review by Xavier Leroy)
### Tools:
- #9551: ocamlobjinfo is now able to display information on .cmxs shared

View File

@ -38,6 +38,9 @@
#ifndef SO_REUSEADDR
#define SO_REUSEADDR (-1)
#endif
#ifndef SO_REUSEPORT
#define SO_REUSEPORT (-1)
#endif
#ifndef SO_KEEPALIVE
#define SO_KEEPALIVE (-1)
#endif
@ -109,6 +112,7 @@ static struct socket_option sockopt_bool[] = {
{ SOL_SOCKET, SO_DEBUG },
{ SOL_SOCKET, SO_BROADCAST },
{ SOL_SOCKET, SO_REUSEADDR },
{ SOL_SOCKET, SO_REUSEPORT },
{ SOL_SOCKET, SO_KEEPALIVE },
{ SOL_SOCKET, SO_DONTROUTE },
{ SOL_SOCKET, SO_OOBINLINE },

View File

@ -597,6 +597,7 @@ type socket_bool_option =
SO_DEBUG
| SO_BROADCAST
| SO_REUSEADDR
| SO_REUSEPORT
| SO_KEEPALIVE
| SO_DONTROUTE
| SO_OOBINLINE

View File

@ -1429,6 +1429,7 @@ type socket_bool_option =
SO_DEBUG (** Record debugging information *)
| SO_BROADCAST (** Permit sending of broadcast messages *)
| SO_REUSEADDR (** Allow reuse of local addresses for bind *)
| SO_REUSEPORT (** Allow reuse of address and port bindings *)
| SO_KEEPALIVE (** Keep connection active *)
| SO_DONTROUTE (** Bypass the standard routing algorithms *)
| SO_OOBINLINE (** Leave out-of-band data in line *)

View File

@ -1175,6 +1175,7 @@ type socket_bool_option =
SO_DEBUG (** Record debugging information *)
| SO_BROADCAST (** Permit sending of broadcast messages *)
| SO_REUSEADDR (** Allow reuse of local addresses for bind *)
| SO_REUSEPORT (** Allow reuse of address and port bindings *)
| SO_KEEPALIVE (** Keep connection active *)
| SO_DONTROUTE (** Bypass the standard routing algorithms *)
| SO_OOBINLINE (** Leave out-of-band data in line *)

View File

@ -21,6 +21,9 @@
#include "unixsupport.h"
#include "socketaddr.h"
#ifndef SO_REUSEPORT
#define SO_REUSEPORT (-1)
#endif
#ifndef IPPROTO_IPV6
#define IPPROTO_IPV6 (-1)
#endif
@ -47,6 +50,7 @@ static struct socket_option sockopt_bool[] = {
{ SOL_SOCKET, SO_DEBUG },
{ SOL_SOCKET, SO_BROADCAST },
{ SOL_SOCKET, SO_REUSEADDR },
{ SOL_SOCKET, SO_REUSEPORT },
{ SOL_SOCKET, SO_KEEPALIVE },
{ SOL_SOCKET, SO_DONTROUTE },
{ SOL_SOCKET, SO_OOBINLINE },

View File

@ -729,6 +729,7 @@ type socket_bool_option =
SO_DEBUG
| SO_BROADCAST
| SO_REUSEADDR
| SO_REUSEPORT
| SO_KEEPALIVE
| SO_DONTROUTE
| SO_OOBINLINE