diff options
author | 2002-12-10 08:00:16 +0000 | |
---|---|---|
committer | 2002-12-10 08:00:16 +0000 | |
commit | 33fbb8c51474527b8fed254e89e937193ef330ac (patch) | |
tree | d2f93d15ba91996a6518bf55bf9e7a4bb452e876 | |
parent | Register as the "std" wscons device, not "sun". This is consistent with other (diff) | |
download | wireguard-openbsd-33fbb8c51474527b8fed254e89e937193ef330ac.tar.xz wireguard-openbsd-33fbb8c51474527b8fed254e89e937193ef330ac.zip |
fix setsockopt SO_REUSEADDR under linux emul; from NetBSD.
thanks to jpmp@fibertel.com.ar for the testbed. ish@ ok
-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: |