From 5cd83ef53984ea2d5fcef4d48cfa0b4927637c27 Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Thu, 24 Apr 2014 15:22:52 -0400 Subject: 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 --- src/sentinel.c | 4 ++-- 1 file 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); -- cgit v1.2.1