diff options
-rw-r--r-- | sys/compat/linux/linux_socket.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index cf876040e04..b51b61056ff 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_socket.c,v 1.26 2002/11/27 07:30:36 ish Exp $ */ +/* $OpenBSD: linux_socket.c,v 1.27 2002/12/10 08:00:16 fgsch Exp $ */ /* $NetBSD: linux_socket.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */ /* @@ -793,7 +793,14 @@ linux_to_bsd_so_sockopt(lopt) case LINUX_SO_DEBUG: return SO_DEBUG; case LINUX_SO_REUSEADDR: - return SO_REUSEADDR; + /* + * Linux does not implement SO_REUSEPORT, but allows reuse + * of a host:port pair through SO_REUSEADDR even if the + * address is not a multicast-address. Effectively, this + * means that we should use SO_REUSEPORT to allow Linux + * applications to not exit with EADDRINUSE. + */ + return SO_REUSEPORT; case LINUX_SO_TYPE: return SO_TYPE; case LINUX_SO_ERROR: |