summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-03-18 12:09:31 +0100
committerantirez <antirez@gmail.com>2015-03-18 12:10:14 +0100
commit438a1a84e8aa37a19a744c38488b261dd62c145c (patch)
tree2f4cbf0c679f93e50bd715a4babb6e628a855fba /src
parent61fb441c8c9b350a48b9f5c3f69a3ce23aa3f9e8 (diff)
downloadredis-438a1a84e8aa37a19a744c38488b261dd62c145c.tar.gz
Cluster: more robust slave check in CLUSTER REPLICATE.
There are rare conditions where node->slaveof may be NULL even if the node is a slave. To check by flag is much more robust.
Diffstat (limited to 'src')
-rw-r--r--src/cluster.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cluster.c b/src/cluster.c
index d4c6300d3..e24b15d2b 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -4071,7 +4071,7 @@ void clusterCommand(redisClient *c) {
}
/* Can't replicate a slave. */
- if (n->slaveof != NULL) {
+ if (nodeIsSlave(n)) {
addReplyError(c,"I can only replicate a master, not a slave.");
return;
}