summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlexander Rössler <mail.aroessler@gmail.com>2015-07-06 17:51:15 +0200
committerKati Kankaanpaa <kati.kankaanpaa@theqtcompany.com>2015-09-22 19:07:15 +0000
commitc28bc5f11361960da1bc94a5ea6566ee0fc8397c (patch)
tree1e36be1a0b5efba8a583b206274f4fc55d23d173 /src
parentec6556a2b99df373eb43ca009340a7f0f19bacbd (diff)
QNativeSocketEngine: fix SO_REUSEPORT problems on Linux
Commit d1cd75e81af809a46fcf40cd2b39858e238a4d97 introduced the usage of the SO_REUSEPORT socket flag on Unix systems if available. However, on Linux systems this socket option behaves differently from the previously used SO_REUSEADDR socket option. This patch disables the use of the SO_REUSEPORT option to fix rebinding problems on Linux. The option was introduced to improve support on OS X and other BSDs. It is not necessary on Linux. [ChangeLog][QtNetwork][QUdpSocket] Fixed a bug that caused the QAbstractSocket::ShareAddress option not to work on Linux. Change-Id: Ice04b8b9e78400dce193e2c1d73b67e33edf8840 Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src')
-rw-r--r--src/network/socket/qnativesocketengine_unix.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp
index 4648a3cb5a..8869d75c8b 100644
--- a/src/network/socket/qnativesocketengine_unix.cpp
+++ b/src/network/socket/qnativesocketengine_unix.cpp
@@ -337,7 +337,7 @@ bool QNativeSocketEnginePrivate::setOption(QNativeSocketEngine::SocketOption opt
int n, level;
convertToLevelAndOption(opt, socketProtocol, level, n);
-#if defined(SO_REUSEPORT)
+#if defined(SO_REUSEPORT) && !defined(Q_OS_LINUX)
if (opt == QNativeSocketEngine::AddressReusable) {
// on OS X, SO_REUSEADDR isn't sufficient to allow multiple binds to the
// same port (which is useful for multicast UDP). SO_REUSEPORT is, but