From ed8c55237b4f2c1c5c5fbac0c0b4d6b12ca7695a Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 10 Mar 2014 10:33:53 +0100 Subject: [PATCH] Cluster: be explicit about passing NULL as bind addr for connect. The code was already correct but it was using that bindaddr[0] is set to NULL as a side effect of current implementation if no bind address is configured. This is not guarnteed to hold true in the future. --- src/cluster.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index ed3f870a..217ffee7 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -2408,7 +2408,8 @@ void clusterCron(void) { clusterLink *link; fd = anetTcpNonBlockBindConnect(server.neterr, node->ip, - node->port+REDIS_CLUSTER_PORT_INCR, server.bindaddr[0]); + node->port+REDIS_CLUSTER_PORT_INCR, + server.bindaddr_count ? server.bindaddr[0] : NULL); if (fd == -1) { redisLog(REDIS_DEBUG, "Unable to connect to " "Cluster Node [%s]:%d -> %s", node->ip,