Commit ed8c5523 authored by antirez's avatar antirez
Browse files

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.
parent 3e8a92ef
...@@ -2408,7 +2408,8 @@ void clusterCron(void) { ...@@ -2408,7 +2408,8 @@ void clusterCron(void) {
clusterLink *link; clusterLink *link;
fd = anetTcpNonBlockBindConnect(server.neterr, node->ip, 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) { if (fd == -1) {
redisLog(REDIS_DEBUG, "Unable to connect to " redisLog(REDIS_DEBUG, "Unable to connect to "
"Cluster Node [%s]:%d -> %s", node->ip, "Cluster Node [%s]:%d -> %s", node->ip,
......
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