Commit ba0d1529 authored by unknown's avatar unknown

ndb - bug#22195

  also bind client to local host name if specified


ndb/src/common/transporter/Transporter.cpp:
  Add binding also of transporter connection (to hostname specified in config file)
parent e64b11b0
...@@ -60,9 +60,6 @@ Transporter::Transporter(TransporterRegistry &t_reg, ...@@ -60,9 +60,6 @@ Transporter::Transporter(TransporterRegistry &t_reg,
} }
strncpy(localHostName, lHostName, sizeof(localHostName)); strncpy(localHostName, lHostName, sizeof(localHostName));
if (strlen(lHostName) > 0)
Ndb_getInAddr(&localHostAddress, lHostName);
DBUG_PRINT("info",("rId=%d lId=%d isServer=%d rHost=%s lHost=%s s_port=%d", DBUG_PRINT("info",("rId=%d lId=%d isServer=%d rHost=%s lHost=%s s_port=%d",
remoteNodeId, localNodeId, isServer, remoteNodeId, localNodeId, isServer,
remoteHostName, localHostName, remoteHostName, localHostName,
...@@ -128,10 +125,23 @@ Transporter::connect_client() { ...@@ -128,10 +125,23 @@ Transporter::connect_client() {
return true; return true;
if(isMgmConnection) if(isMgmConnection)
{
sockfd= m_transporter_registry.connect_ndb_mgmd(m_socket_client); sockfd= m_transporter_registry.connect_ndb_mgmd(m_socket_client);
}
else else
{
if (!m_socket_client->init())
{
return false;
}
if (strlen(localHostName) > 0)
{
if (m_socket_client->bind(localHostName, 0) != 0)
return false;
}
sockfd= m_socket_client->connect(); sockfd= m_socket_client->connect();
}
return connect_client(sockfd); return connect_client(sockfd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment