Commit 75e68625 authored by Matt Stancliff's avatar Matt Stancliff Committed by antirez
Browse files

Parse cluster state file in IPv6 compatible way

We need to pick the port based on the _last_ colon, not the first one.
parent bb0ff49e
......@@ -178,7 +178,7 @@ int clusterLoadConfig(char *filename) {
clusterAddNode(n);
}
/* Address and port */
if ((p = strchr(argv[1],':')) == NULL) goto fmterr;
if ((p = strrchr(argv[1],':')) == NULL) goto fmterr;
*p = '\0';
memcpy(n->ip,argv[1],strlen(argv[1])+1);
n->port = atoi(p+1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment