Remove redundant IP length definition

REDIS_CLUSTER_IPLEN had the same value as
REDIS_IP_STR_LEN.  They were both #define'd
to the same INET6_ADDRSTRLEN.
This commit is contained in:
Matt Stancliff 2014-02-26 18:05:12 -05:00 committed by antirez
parent d2040ab9b1
commit 385c25f70f
2 changed files with 3 additions and 4 deletions

View File

@ -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

View File

@ -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). */