summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-05-14 07:47:59 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-05-14 07:47:59 +0000
commit22bacaa9944c0f68a2916abfe37a8061e9ef4480 (patch)
tree2b70adcf4cd0b441c525ec6bc5eb0c6011f4a350
parent38d2cfe4fc1f9253d2938052b817921e6c27aa5b (diff)
- use hostip instead of hostname to avoid dependency on resolver
-rw-r--r--src/testbed/testbed_api_hosts.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index 374fee8ef..c2686ea62 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -1069,6 +1069,7 @@ helper_mst (void *cls, void *client, const struct GNUNET_MessageHeader *message)
struct GNUNET_TESTBED_ControllerProc *cp = cls;
const struct GNUNET_TESTBED_HelperReply *msg;
const char *hostname;
+ const char *hostip;
char *config;
uLongf config_size;
uLongf xconfig_size;
@@ -1096,9 +1097,12 @@ helper_mst (void *cls, void *client, const struct GNUNET_MessageHeader *message)
if ((NULL == cp->host) ||
(NULL == (hostname = GNUNET_TESTBED_host_get_hostname (cp->host))))
hostname = "localhost";
+ hostip = simple_resolve (hostname);
+ if (NULL == hostip)
+ hostip = "127.0.0.1";
/* Change the hostname so that we can connect to it */
GNUNET_CONFIGURATION_set_value_string (cp->host->cfg, "testbed", "hostname",
- hostname);
+ hostip);
cp->host->locked = GNUNET_NO;
cp->host->controller_started = GNUNET_YES;
cp->cb (cp->cls, cp->host->cfg, GNUNET_OK);