diff --git a/src/cluster.c b/src/cluster.c index e6da3a66fc3bcf8d745fa23566dc3892b64940a6..f4ddeef4e0ab3d07e2202b17a6402c1688696085 100644 --- a/src/cluster.c +++ b/src/cluster.c @@ -915,11 +915,11 @@ int clusterStartHandshake(char *ip, int port) { if (sa.ss_family == AF_INET) inet_ntop(AF_INET, (void*)&(((struct sockaddr_in *)&sa)->sin_addr), - norm_ip,REDIS_CLUSTER_IPLEN); + norm_ip,REDIS_IP_STR_LEN); else inet_ntop(AF_INET6, (void*)&(((struct sockaddr_in6 *)&sa)->sin6_addr), - norm_ip,REDIS_CLUSTER_IPLEN); + norm_ip,REDIS_IP_STR_LEN); if (clusterHandshakeInProgress(norm_ip,port)) { errno = EAGAIN; @@ -1021,7 +1021,7 @@ void clusterProcessGossipSection(clusterMsg *hdr, clusterLink *link) { /* IP -> string conversion. 'buf' is supposed to at least be 46 bytes. */ void nodeIp2String(char *buf, clusterLink *link) { - anetPeerToString(link->fd, buf, REDIS_CLUSTER_IPLEN, NULL); + anetPeerToString(link->fd, buf, REDIS_IP_STR_LEN, NULL); } /* Update the node address to the IP address that can be extracted diff --git a/src/cluster.h b/src/cluster.h index 654274b9bb40fa5d786b8c6671f4af2db21aff4e..8c440b9f88929a84fd15aacb27c4b6a872c4f0e5 100644 --- a/src/cluster.h +++ b/src/cluster.h @@ -10,7 +10,6 @@ #define REDIS_CLUSTER_FAIL 1 /* The cluster can't work */ #define REDIS_CLUSTER_NAMELEN 40 /* sha1 hex length */ #define REDIS_CLUSTER_PORT_INCR 10000 /* Cluster port = baseport + PORT_INCR */ -#define REDIS_CLUSTER_IPLEN INET6_ADDRSTRLEN /* IPv6 address string length */ /* The following defines are amunt of time, sometimes expressed as * multiplicators of the node timeout value (when ending with MULT). */