summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/IceDiscovery/PluginI.cpp3
-rw-r--r--cpp/src/IceGrid/Client.cpp3
-rw-r--r--cpp/src/IceGrid/RegistryI.cpp3
-rw-r--r--cpp/src/IceGridLib/DiscoveryPluginI.cpp3
-rwxr-xr-xcpp/test/IceDiscovery/simple/run.py4
-rw-r--r--cpp/test/IceGrid/simple/AllTests.cpp6
6 files changed, 17 insertions, 5 deletions
diff --git a/cpp/src/IceDiscovery/PluginI.cpp b/cpp/src/IceDiscovery/PluginI.cpp
index 88c2bb91ba5..60bdf42e9a4 100644
--- a/cpp/src/IceDiscovery/PluginI.cpp
+++ b/cpp/src/IceDiscovery/PluginI.cpp
@@ -41,8 +41,9 @@ PluginI::initialize()
Ice::PropertiesPtr properties = _communicator->getProperties();
bool ipv4 = properties->getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0;
+ bool preferIPv6 = properties->getPropertyAsInt("Ice.PreferIPv6Address") > 0;
string address;
- if(ipv4)
+ if(ipv4 && !preferIPv6)
{
address = properties->getPropertyWithDefault("IceDiscovery.Address", "239.255.0.1");
}
diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp
index 6e9b51388e2..20e8fe7cdc4 100644
--- a/cpp/src/IceGrid/Client.cpp
+++ b/cpp/src/IceGrid/Client.cpp
@@ -551,7 +551,8 @@ Client::run(StringSeq& originalArgs)
{
bool ipv4 = properties->getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0;
string address;
- if(ipv4)
+ bool preferIPv6 = properties->getPropertyAsInt("Ice.PreferIPv6Address") > 0;
+ if(ipv4 && !preferIPv6)
{
address = properties->getPropertyWithDefault("IceGridAdmin.Discovery.Address", "239.255.0.1");
}
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp
index 843b8b15cfa..e49f0cf49bf 100644
--- a/cpp/src/IceGrid/RegistryI.cpp
+++ b/cpp/src/IceGrid/RegistryI.cpp
@@ -577,8 +577,9 @@ RegistryI::startImpl()
if(properties->getPropertyAsIntWithDefault("IceGrid.Registry.Discovery.Enabled", 1) > 0)
{
bool ipv4 = properties->getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0;
+ bool preferIPv6 = properties->getPropertyAsInt("Ice.PreferIPv6Address") > 0;
string address;
- if(ipv4)
+ if(ipv4 && !preferIPv6)
{
address = properties->getPropertyWithDefault("IceGrid.Registry.Discovery.Address", "239.255.0.1");
}
diff --git a/cpp/src/IceGridLib/DiscoveryPluginI.cpp b/cpp/src/IceGridLib/DiscoveryPluginI.cpp
index b6c587d6c09..c9803cdf3e5 100644
--- a/cpp/src/IceGridLib/DiscoveryPluginI.cpp
+++ b/cpp/src/IceGridLib/DiscoveryPluginI.cpp
@@ -179,8 +179,9 @@ DiscoveryPluginI::initialize()
Ice::PropertiesPtr properties = _communicator->getProperties();
bool ipv4 = properties->getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0;
+ bool preferIPv6 = properties->getPropertyAsInt("Ice.PreferIPv6Address") > 0;
string address;
- if(ipv4)
+ if(ipv4 && !preferIPv6)
{
address = properties->getPropertyWithDefault("IceGridDiscovery.Address", "239.255.0.1");
}
diff --git a/cpp/test/IceDiscovery/simple/run.py b/cpp/test/IceDiscovery/simple/run.py
index bfd22278207..d26af2db53d 100755
--- a/cpp/test/IceDiscovery/simple/run.py
+++ b/cpp/test/IceDiscovery/simple/run.py
@@ -30,7 +30,9 @@ args += " --IceDiscovery.Timeout=100"
args += " --IceDiscovery.RetryCount=1"
if not TestUtil.ipv6:
args += " --IceDiscovery.Interface=127.0.0.1"
-
+elif TestUtil.isDarwin():
+ args += " --IceDiscovery.Interface=\"::1\""
+
serverProc = []
for i in range(0, num):
sys.stdout.write("starting server #%d... " % (i + 1))
diff --git a/cpp/test/IceGrid/simple/AllTests.cpp b/cpp/test/IceGrid/simple/AllTests.cpp
index 184e18adac7..4f650f40fae 100644
--- a/cpp/test/IceGrid/simple/AllTests.cpp
+++ b/cpp/test/IceGrid/simple/AllTests.cpp
@@ -67,6 +67,12 @@ allTests(const Ice::CommunicatorPtr& communicator)
initData.properties = communicator->getProperties()->clone();
initData.properties->setProperty("Ice.Default.Locator", "");
initData.properties->setProperty("Ice.Plugin.IceGridDiscovery", "IceGrid:createIceGridDiscovery");
+#ifdef __APPLE__
+ if(initData.properties->getPropertyAsInt("Ice.PreferIPv6Address") > 0)
+ {
+ initData.properties->setProperty("IceGridDiscovery.Interface", "::1");
+ }
+#endif
initData.properties->setProperty("AdapterForDiscoveryTest.AdapterId", "discoveryAdapter");
initData.properties->setProperty("AdapterForDiscoveryTest.Endpoints", "default");