summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Instance.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2014-11-13 14:37:13 +0100
committerBenoit Foucher <benoit@zeroc.com>2014-11-13 14:37:13 +0100
commit180e3f6b12c252cda2ced3ad95e99884c778111c (patch)
tree36096594477bbd97715300bcaeb272b8b5233831 /cpp/src/Ice/Instance.cpp
parentICE-5875 confusing tracing when binding to 0.0.0.0 (diff)
downloadice-180e3f6b12c252cda2ced3ad95e99884c778111c.tar.bz2
ice-180e3f6b12c252cda2ced3ad95e99884c778111c.tar.xz
ice-180e3f6b12c252cda2ced3ad95e99884c778111c.zip
Fixed ICE-5877: disabled IPv6 by default is not supported on the system
Diffstat (limited to 'cpp/src/Ice/Instance.cpp')
-rw-r--r--cpp/src/Ice/Instance.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index 5f9034be027..66dc8abb135 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -1316,8 +1316,9 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi
_proxyFactory = new ProxyFactory(this);
- bool ipv4 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0;
- bool ipv6 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv6", 1) > 0;
+ const bool isIPv6Supported = IceInternal::isIPv6Supported();
+ const bool ipv4 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0;
+ const bool ipv6 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv6", isIPv6Supported ? 1 : 0) > 0;
if(!ipv4 && !ipv6)
{
throw InitializationException(__FILE__, __LINE__, "Both IPV4 and IPv6 support cannot be disabled.");