summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2015-08-14 07:19:13 +0200
committerBenoit Foucher <benoit@zeroc.com>2015-08-14 07:19:13 +0200
commitb0f0bc95d4db337fa4250dd8c320d921908f55a2 (patch)
tree477644c3b5b3822f4d12a5a269406d2928aebf2e /cpp
parentAnother minor fix for Expect.py script (diff)
downloadice-b0f0bc95d4db337fa4250dd8c320d921908f55a2.tar.bz2
ice-b0f0bc95d4db337fa4250dd8c320d921908f55a2.tar.xz
ice-b0f0bc95d4db337fa4250dd8c320d921908f55a2.zip
Revert "Fixed ICE-6707 - default interface for discovery is now Ice.Default.Host if it is set"
This reverts commit 406e393f2be3a29830a7758e58e4e674afc5e21e.
Diffstat (limited to 'cpp')
-rw-r--r--cpp/src/IceDiscovery/PluginI.cpp23
-rw-r--r--cpp/src/IceGrid/RegistryI.cpp23
-rw-r--r--cpp/src/IceLocatorDiscovery/PluginI.cpp23
-rwxr-xr-xcpp/test/IceDiscovery/simple/run.py4
-rw-r--r--cpp/test/IceGrid/simple/AllTests.cpp6
5 files changed, 11 insertions, 68 deletions
diff --git a/cpp/src/IceDiscovery/PluginI.cpp b/cpp/src/IceDiscovery/PluginI.cpp
index cbc9a22c5f0..e0e1a7f9849 100644
--- a/cpp/src/IceDiscovery/PluginI.cpp
+++ b/cpp/src/IceDiscovery/PluginI.cpp
@@ -14,8 +14,6 @@
#include <IceDiscovery/LocatorI.h>
#include <IceDiscovery/LookupI.h>
-#include <Ice/Network.h>
-
using namespace std;
using namespace IceDiscovery;
@@ -74,27 +72,6 @@ PluginI::initialize()
}
int port = properties->getPropertyAsIntWithDefault("IceDiscovery.Port", 4061);
string interface = properties->getProperty("IceDiscovery.Interface");
- string defaultHost = properties->getProperty("Ice.Default.Host");
- if(interface.empty() && !defaultHost.empty())
- {
- //
- // Make sure the interface is an IP address, the UDP --interface option
- // doesn't support DNS names.
- //
- IceInternal::ProtocolSupport protocol = ipv4 && !preferIPv6 ? IceInternal::EnableIPv4 : IceInternal::EnableIPv6;
- try
- {
- IceInternal::Address address = IceInternal::getAddressForServer(defaultHost, 0, protocol, preferIPv6);
- if(IceInternal::isAddressValid(address))
- {
- interface = IceInternal::inetAddrToString(address);
- }
- }
- catch(const Ice::LocalException&)
- {
- // Ignore
- }
- }
if(properties->getProperty("IceDiscovery.Multicast.Endpoints").empty())
{
diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp
index ac126a43dd8..d8a406931f4 100644
--- a/cpp/src/IceGrid/RegistryI.cpp
+++ b/cpp/src/IceGrid/RegistryI.cpp
@@ -11,6 +11,7 @@
#include <IceUtil/FileUtil.h>
#include <Ice/Ice.h>
#include <Ice/Network.h>
+#include <Ice/ProtocolPluginFacade.h> // Just to get the hostname
#include <IceStorm/Service.h>
#include <IceSSL/IceSSL.h>
@@ -591,28 +592,6 @@ RegistryI::startImpl()
}
int port = properties->getPropertyAsIntWithDefault("IceGrid.Registry.Discovery.Port", 4061);
string interface = properties->getProperty("IceGrid.Registry.Discovery.Interface");
- string defaultHost = properties->getProperty("Ice.Default.Host");
- if(interface.empty() && !defaultHost.empty())
- {
- //
- // Make sure the interface is an IP address, the UDP --interface option
- // doesn't support DNS names.
- //
- IceInternal::ProtocolSupport protocol = ipv4 && !preferIPv6 ? IceInternal::EnableIPv4 : IceInternal::EnableIPv6;
- try
- {
- IceInternal::Address address = IceInternal::getAddressForServer(defaultHost, 0, protocol, preferIPv6);
- if(IceInternal::isAddressValid(address))
- {
- interface = IceInternal::inetAddrToString(address);
- }
- }
- catch(const Ice::LocalException&)
- {
- // Ignore
- }
- }
-
if(properties->getProperty("IceGrid.Registry.Discovery.Endpoints").empty())
{
ostringstream os;
diff --git a/cpp/src/IceLocatorDiscovery/PluginI.cpp b/cpp/src/IceLocatorDiscovery/PluginI.cpp
index 65844d39c3f..bf30aa4cf8e 100644
--- a/cpp/src/IceLocatorDiscovery/PluginI.cpp
+++ b/cpp/src/IceLocatorDiscovery/PluginI.cpp
@@ -13,8 +13,6 @@
#include <IceLocatorDiscovery/PluginI.h>
#include <IceLocatorDiscovery/IceLocatorDiscovery.h>
-#include <Ice/Network.h>
-
using namespace std;
using namespace IceLocatorDiscovery;
@@ -204,27 +202,6 @@ PluginI::initialize()
}
int port = properties->getPropertyAsIntWithDefault("IceLocatorDiscovery.Port", 4061);
string intf = properties->getProperty("IceLocatorDiscovery.Interface");
- string defaultHost = properties->getProperty("Ice.Default.Host");
- if(intf.empty() && !defaultHost.empty())
- {
- //
- // Make sure the interface is an IP address, the UDP --interface option
- // doesn't support DNS names.
- //
- IceInternal::ProtocolSupport protocol = ipv4 && !preferIPv6 ? IceInternal::EnableIPv4 : IceInternal::EnableIPv6;
- try
- {
- IceInternal::Address address = IceInternal::getAddressForServer(defaultHost, 0, protocol, preferIPv6);
- if(IceInternal::isAddressValid(address))
- {
- intf = IceInternal::inetAddrToString(address);
- }
- }
- catch(const Ice::LocalException&)
- {
- // Ignore
- }
- }
if(properties->getProperty("IceLocatorDiscovery.Reply.Endpoints").empty())
{
diff --git a/cpp/test/IceDiscovery/simple/run.py b/cpp/test/IceDiscovery/simple/run.py
index e48dd655664..5de3fedd862 100755
--- a/cpp/test/IceDiscovery/simple/run.py
+++ b/cpp/test/IceDiscovery/simple/run.py
@@ -27,6 +27,10 @@ num = 3
args = " --IceDiscovery.Timeout=50"
args += " --IceDiscovery.RetryCount=5"
+if not TestUtil.ipv6:
+ args += " --IceDiscovery.Interface=127.0.0.1"
+elif TestUtil.isDarwin():
+ args += " --IceDiscovery.Interface=\"::1\""
# Set the plugin property only for the server, the client uses Ice::registerIceDiscovery()
serverArgs = " --Ice.Plugin.IceDiscovery=IceDiscovery:createIceDiscovery" + args
diff --git a/cpp/test/IceGrid/simple/AllTests.cpp b/cpp/test/IceGrid/simple/AllTests.cpp
index c51673118e5..e2cd0bb95f9 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.IceLocatorDiscovery", "IceLocatorDiscovery:createIceLocatorDiscovery");
+#ifdef __APPLE__
+ if(initData.properties->getPropertyAsInt("Ice.PreferIPv6Address") > 0)
+ {
+ initData.properties->setProperty("IceLocatorDiscovery.Interface", "::1");
+ }
+#endif
initData.properties->setProperty("AdapterForDiscoveryTest.AdapterId", "discoveryAdapter");
initData.properties->setProperty("AdapterForDiscoveryTest.Endpoints", "default");