diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-01-21 15:08:15 (GMT) |
---|---|---|
committer | Shane Kearns <shane.kearns@accenture.com> | 2011-01-21 15:43:30 (GMT) |
commit | b10fe4c9efa0767c9591fa19c86ff7e5c3f88860 (patch) | |
tree | f0a752d499d47109ccd31289dc0ca4be3952c4c2 /src/network/socket | |
parent | 47ac9016fc778f10f4d5ab1abb056b0d0cc2963a (diff) | |
download | Qt-b10fe4c9efa0767c9591fa19c86ff7e5c3f88860.zip Qt-b10fe4c9efa0767c9591fa19c86ff7e5c3f88860.tar.gz Qt-b10fe4c9efa0767c9591fa19c86ff7e5c3f88860.tar.bz2 |
Fix IPv6 server connections
Symbian treats listening on "0.0.0.0" to mean "accept any IPv4"
and listening on "::" to mean "accept any IPv6".
To accept any connection, you must listen with an unspecified address
As the Qt documentation explicitly says QHostAddress::Any means to
accept any connection, this is converted to an unspecified address
(KAfUnspec) by the symbian socket engine.
Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network/socket')
-rw-r--r-- | src/network/socket/qsymbiansocketengine.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/network/socket/qsymbiansocketengine.cpp b/src/network/socket/qsymbiansocketengine.cpp index 9ed8a42..cc55f2a 100644 --- a/src/network/socket/qsymbiansocketengine.cpp +++ b/src/network/socket/qsymbiansocketengine.cpp @@ -221,7 +221,12 @@ bool QSymbianSocketEnginePrivate::createNewSocket(QAbstractSocket::SocketType so void QSymbianSocketEnginePrivate::setPortAndAddress(TInetAddr& nativeAddr, quint16 port, const QHostAddress &addr) { nativeAddr.SetPort(port); - if (addr.protocol() == QAbstractSocket::IPv6Protocol) { + if (addr == QHostAddress::Any) { + //Should allow both IPv4 and IPv6 + //Listening on "0.0.0.0" accepts ONLY ipv4 connections + //Listening on "::" accepts ONLY ipv6 connections + nativeAddr.SetFamily(KAFUnspec); + } else if (addr.protocol() == QAbstractSocket::IPv6Protocol) { TPckgBuf<TSoInetIfQuery> query; query().iName = qt_QString2TPtrC(addr.scopeId()); TInt err = nativeSocket.GetOpt(KSoInetIfQueryByName, KSolInetIfQuery, query); |