diff --git a/src/sentinel.c b/src/sentinel.c index 603cdd4049a38f907bbfbd5395a389c3e4da8d60..d26705c224f5320d5f19b70f69a5804419e826f1 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -2216,9 +2216,10 @@ int sentinelSendHello(sentinelRedisInstance *ri) { sentinelRedisInstance *master = (ri->flags & SRI_MASTER) ? ri : ri->master; sentinelAddr *master_addr = sentinelGetCurrentMasterAddress(master); + if (ri->flags & SRI_DISCONNECTED) return REDIS_ERR; + /* Try to obtain our own IP address. */ if (anetSockName(ri->cc->c.fd,ip,sizeof(ip),NULL) == -1) return REDIS_ERR; - if (ri->flags & SRI_DISCONNECTED) return REDIS_ERR; /* Format and send the Hello message. */ snprintf(payload,sizeof(payload),