summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2014-04-24 15:22:52 -0400
committerantirez <antirez@gmail.com>2014-06-23 11:44:35 +0200
commit5cd83ef53984ea2d5fcef4d48cfa0b4927637c27 (patch)
treeb6d88f5b082e02370a7bbab26a3983c68e88b993
parentd830dcb12d0a99bf5488cb58c3a541b9387dcfb0 (diff)
downloadredis-5cd83ef53984ea2d5fcef4d48cfa0b4927637c27.tar.gz
Sentinel: bind source address
Some deployments need traffic sent from a specific address. This change uses the same policy as Cluster where the first listed bindaddr becomes the source address for outgoing Sentinel communication. Fixes #1667
-rw-r--r--src/sentinel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index 7f81443bb..f94ec9f26 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -1676,7 +1676,7 @@ void sentinelReconnectInstance(sentinelRedisInstance *ri) {
/* Commands connection. */
if (ri->cc == NULL) {
- ri->cc = redisAsyncConnect(ri->addr->ip,ri->addr->port);
+ ri->cc = redisAsyncConnectBind(ri->addr->ip,ri->addr->port,REDIS_BIND_ADDR);
if (ri->cc->err) {
sentinelEvent(REDIS_DEBUG,"-cmd-link-reconnection",ri,"%@ #%s",
ri->cc->errstr);
@@ -1698,7 +1698,7 @@ void sentinelReconnectInstance(sentinelRedisInstance *ri) {
}
/* Pub / Sub */
if ((ri->flags & (SRI_MASTER|SRI_SLAVE)) && ri->pc == NULL) {
- ri->pc = redisAsyncConnect(ri->addr->ip,ri->addr->port);
+ ri->pc = redisAsyncConnectBind(ri->addr->ip,ri->addr->port,REDIS_BIND_ADDR);
if (ri->pc->err) {
sentinelEvent(REDIS_DEBUG,"-pubsub-link-reconnection",ri,"%@ #%s",
ri->pc->errstr);