summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Stancliff <matt@genges.com>2014-02-26 18:05:12 -0500
committerantirez <antirez@gmail.com>2014-03-11 11:10:09 +0100
commit4b3c87a0276260216c6ce26d0dbd2d3bc9bd14fe (patch)
tree8e31cbcc051960643e34c2c86a0e53b682a7fc9f
parent7c8964a8cf42d33f9e0ca65c9990978b16baa386 (diff)
downloadredis-4b3c87a0276260216c6ce26d0dbd2d3bc9bd14fe.tar.gz
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.
-rw-r--r--src/cluster.c6
-rw-r--r--src/cluster.h1
2 files changed, 3 insertions, 4 deletions
diff --git a/src/cluster.c b/src/cluster.c
index cc2ceb24c..50eb3e2f3 100644
--- a/src/cluster.c
+++ b/src/cluster.c
@@ -928,11 +928,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;
@@ -1034,7 +1034,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 654274b9b..8c440b9f8 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). */