diff options
author | Vadim Troshchinskiy <vtroshchinskiy@qindel.com> | 2016-12-13 12:00:43 +0100 |
---|---|---|
committer | Vadim Troshchinskiy <vtroshchinskiy@qindel.com> | 2016-12-14 11:43:07 +0100 |
commit | 920f423a59b568cf91128f8e1fa8374e521141ca (patch) | |
tree | 7a402d5a65ace7b18d0db0cc13fe5b31c2276758 | |
parent | e466a9387d4db49784276b9b0eabf8f49f01b87f (diff) | |
download | nx-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.cpp | 12 |
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()) |