summaryrefslogtreecommitdiff
path: root/erts/emulator/drivers
diff options
context:
space:
mode:
authorMicael Karlberg <bmk@erlang.org>2021-12-22 14:36:41 +0100
committerMicael Karlberg <bmk@erlang.org>2021-12-22 14:36:41 +0100
commit35c00ed8ae368a507445ce553b3e156f010bfe00 (patch)
treeae4c9202c39e87bbaadabf5e7b28faf2de2c5934 /erts/emulator/drivers
parent5b6931f001a00bff730867fdf07a8580eb989e24 (diff)
parent2a6ac6f3f027fcab6d607599e82714e930d9fde2 (diff)
downloaderlang-35c00ed8ae368a507445ce553b3e156f010bfe00.tar.gz
Merge branch 'bmk/kernel/20211117/simple_reuseaddr_on_win/OTP-17447-25'
OTP-17447
Diffstat (limited to 'erts/emulator/drivers')
-rw-r--r--erts/emulator/drivers/common/inet_drv.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index 712e23fc31..a79cf2bd9d 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -6638,15 +6638,16 @@ static int inet_set_opts(inet_descriptor* desc, char* ptr, int len)
desc->delimiter = (char)ival;
continue;
- case INET_OPT_REUSEADDR:
-#ifdef __WIN32__
- continue; /* Bjorn says */
-#else
- type = SO_REUSEADDR;
+ /* The behaviour changed in Windows Server 2003.
+ * Now it works as the combo of `SO_REUSEADDR` and
+ * `SO_REUSEPORT` does on *BSD.
+ * This option was "dangerous" only in Windows XP,
+ * which we don't support anymore!
+ */
+ case INET_OPT_REUSEADDR: type = SO_REUSEADDR;
DEBUGF(("inet_set_opts(%p): s=%d, SO_REUSEADDR=%d\r\n",
desc->port, desc->s,ival));
break;
-#endif
case INET_OPT_KEEPALIVE: type = SO_KEEPALIVE;
DEBUGF(("inet_set_opts(%p): s=%d, SO_KEEPALIVE=%d\r\n",
desc->port, desc->s, ival));