Skip to content

Commit

Permalink
Modules: Fix RM_GetClusterNodeInfo() to correctly populate the master…
Browse files Browse the repository at this point in the history
…_id (redis#8846)
  • Loading branch information
iakkus authored Apr 25, 2021
1 parent e43dbd0 commit af035c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -6168,7 +6168,7 @@ int RM_GetClusterNodeInfo(RedisModuleCtx *ctx, const char *id, char *ip, char *m
/* If the information is not available, the function will set the
* field to zero bytes, so that when the field can't be populated the
* function kinda remains predictable. */
if (node->flags & CLUSTER_NODE_MASTER && node->slaveof)
if (node->flags & CLUSTER_NODE_SLAVE && node->slaveof)
memcpy(master_id,node->slaveof->name,REDISMODULE_NODE_ID_LEN);
else
memset(master_id,0,REDISMODULE_NODE_ID_LEN);
Expand Down

0 comments on commit af035c1

Please sign in to comment.