diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2010-05-06 11:03:40 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2010-09-01 12:24:39 (GMT) |
commit | ace9e3f77632f5ef47cccf32a204880ebf6a0581 (patch) | |
tree | 42f134bb8f786286634c4483240c908c152524ff /src/network | |
parent | 140cde65eb7eb8ccede25f1759699835ff479bc5 (diff) | |
download | Qt-ace9e3f77632f5ef47cccf32a204880ebf6a0581.zip Qt-ace9e3f77632f5ef47cccf32a204880ebf6a0581.tar.gz Qt-ace9e3f77632f5ef47cccf32a204880ebf6a0581.tar.bz2 |
Set multicast errors correctly
If the system does not support SSM, but the source address is specified,
the error is unsupported socket operation, not unsupported protocol.
if setsockopt() returns an error we don't know about, set the error
code/string to unknown error
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/socket/qnativesocketengine_unix.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/network/socket/qnativesocketengine_unix.cpp b/src/network/socket/qnativesocketengine_unix.cpp index 512cd34..4be45b8 100644 --- a/src/network/socket/qnativesocketengine_unix.cpp +++ b/src/network/socket/qnativesocketengine_unix.cpp @@ -634,9 +634,9 @@ static bool doMulticast(QNativeSocketEnginePrivate *d, ssm4.imr_multiaddr.s_addr = htonl(groupAddress.toIPv4Address()); ssm4.imr_sourceaddr.s_addr = htonl(sourceAddress.toIPv4Address()); #else - // unreachable + // system doesn't support SSM d->setError(QAbstractSocket::UnsupportedSocketOperationError, - QNativeSocketEnginePrivate::ProtocolUnsupportedErrorString); + QNativeSocketEnginePrivate::OperationUnsupportedErrorString); return false; #endif } else { @@ -675,6 +675,8 @@ static bool doMulticast(QNativeSocketEnginePrivate *d, QNativeSocketEnginePrivate::OperationUnsupportedErrorString); break; default: + d->setError(QAbstractSocket::UnknownSocketError, + QNativeSocketEnginePrivate::UnknownSocketErrorString); break; } return false; |