aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Troshchinskiy <vtroshchinskiy@qindel.com>2016-12-13 12:00:43 +0100
committerVadim Troshchinskiy <vtroshchinskiy@qindel.com>2016-12-14 11:43:07 +0100
commit920f423a59b568cf91128f8e1fa8374e521141ca (patch)
tree7a402d5a65ace7b18d0db0cc13fe5b31c2276758
parente466a9387d4db49784276b9b0eabf8f49f01b87f (diff)
downloadnx-libs-920f423a59b568cf91128f8e1fa8374e521141ca.tar.gz
nx-libs-920f423a59b568cf91128f8e1fa8374e521141ca.tar.bz2
nx-libs-920f423a59b568cf91128f8e1fa8374e521141ca.zip
Make nxagent only bind to loopback when requested
-rw-r--r--nxcomp/Loop.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp
index c566aa2d1..86c951a06 100644
--- a/nxcomp/Loop.cpp
+++ b/nxcomp/Loop.cpp
@@ -6692,11 +6692,15 @@ int WaitForRemote(ChannelEndPoint &socketAddress)
strcpy(hostLabel, "any host");
}
- if (loopbackBind)
+ long bindPort;
+ if (socketAddress.getTCPHostAndPort(NULL, &bindPort))
{
- long bindPort;
- if (socketAddress.getTCPHostAndPort(NULL, &bindPort))
- socketAddress.setSpec("localhost", bindPort);
+ socketAddress.setSpec(loopbackBind ? "localhost" : "*", bindPort);
+ }
+ else
+ {
+ // This should never happen
+ cerr << "Error" << ": Unable to change bind host\n";
}
}
else if (socketAddress.isUnixSocket())