From daca1edb6ec8d8b467d2e94a39431c47dff7052b Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Thu, 23 Oct 2014 13:45:16 -0400 Subject: [PATCH] Parse cluster state file in IPv6 compatible way We need to pick the port based on the _last_ colon, not the first one. --- src/cluster.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluster.c b/src/cluster.c index 8a788da6..10ed25db 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -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);