summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2014-10-31 10:01:59 +0100
committerSalvatore Sanfilippo <antirez@gmail.com>2014-10-31 10:01:59 +0100
commita07674307925c9af0226a71c11daffabea3ad764 (patch)
tree181ca1ed5e0a45b0650c5f34d6e8b6822d6ce66f
parent2c42b645bcb412e447746619480d58b7cdc058e6 (diff)
parent0014966c1e39cf2dcb4ca271900b93990d823bec (diff)
downloadredis-a07674307925c9af0226a71c11daffabea3ad764.tar.gz
Merge pull request #2110 from mattsta/more-outbound-bind-fixes
Networking: add more outbound IP binding fixes
-rw-r--r--src/cluster.c4
-rw-r--r--src/replication.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/cluster.c b/src/cluster.c
index 8a788da67..1967b3f42 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -4307,8 +4307,8 @@ int migrateGetSocket(redisClient *c, robj *host, robj *port, long timeout) {
}
/* Create the socket */
- fd = anetTcpNonBlockConnect(server.neterr,c->argv[1]->ptr,
- atoi(c->argv[2]->ptr));
+ fd = anetTcpNonBlockBindConnect(server.neterr,c->argv[1]->ptr,
+ atoi(c->argv[2]->ptr),REDIS_BIND_ADDR);
if (fd == -1) {
sdsfree(name);
addReplyErrorFormat(c,"Can't connect to target node: %s",
diff --git a/src/replication.c b/src/replication.c
index 77f9fa8bc..1a4ca2503 100644
--- a/src/replication.c
+++ b/src/replication.c
@@ -1357,7 +1357,8 @@ error:
int connectWithMaster(void) {
int fd;
- fd = anetTcpNonBlockConnect(NULL,server.masterhost,server.masterport);
+ fd = anetTcpNonBlockBindConnect(NULL,
+ server.masterhost,server.masterport,REDIS_BIND_ADDR);
if (fd == -1) {
redisLog(REDIS_WARNING,"Unable to connect to MASTER: %s",
strerror(errno));