summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2010-05-06 11:03:40 (GMT)
committerBradley T. Hughes <bradley.hughes@nokia.com>2010-09-01 12:24:39 (GMT)
commitace9e3f77632f5ef47cccf32a204880ebf6a0581 (patch)
tree42f134bb8f786286634c4483240c908c152524ff /src/network
parent140cde65eb7eb8ccede25f1759699835ff479bc5 (diff)
downloadQt-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.cpp6
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;