summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Cavar <wizzard405@yahoo.com>2016-02-09 15:04:42 +0100
committerantirez <antirez@gmail.com>2016-05-05 10:13:23 +0200
commit787d5ab9be45bf4feb6cfa8a227c185c93aaadae (patch)
tree3c59339ea21bc6547b2610d0989b6eb4da269fe4
parent0fda06225f19b18a370d63ac650a8bb61020235d (diff)
downloadredis-787d5ab9be45bf4feb6cfa8a227c185c93aaadae.tar.gz
Reverse redirect address parse
Fix issue in case the redirect address is in ipv6 format. Parse from behind to extract last part of the response which represents actual port.
-rw-r--r--src/redis-cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/redis-cli.c b/src/redis-cli.c
index d44b1bf3e..349c75c38 100644
--- a/src/redis-cli.c
+++ b/src/redis-cli.c
@@ -738,7 +738,7 @@ static int cliReadReply(int output_raw_strings) {
p = strchr(s+1,' '); /* MOVED[S]3999[P]127.0.0.1:6381 */
*p = '\0';
slot = atoi(s+1);
- s = strchr(p+1,':'); /* MOVED 3999[P]127.0.0.1[S]6381 */
+ s = strrchr(p+1,':'); /* MOVED 3999[P]127.0.0.1[S]6381 */
*s = '\0';
sdsfree(config.hostip);
config.hostip = sdsnew(p+1);