From 68d72aa5b16a23886b801523b116b66936f7e957 Mon Sep 17 00:00:00 2001 From: Geoff Garside Date: Sat, 18 Jun 2011 19:06:26 +0100 Subject: [PATCH] Add macro to define clusterNode.ip buffer size. Add REDIS_CLUSTER_IPLEN macro to define the size of the clusterNode ip character array. Additionally use this macro in inet_ntop(3) calls where the size of the array was being defined manually. The REDIS_CLUSTER_IPLEN is defined as INET_ADDRSTRLEN which defines the correct size of a buffer to store an IPv4 address in. The INET_ADDRSTRLEN macro itself is defined in the header file and should be portable across the majority of systems. --- src/redis.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/redis.h b/src/redis.h index 4cf3c51d..2fb03441 100644 --- a/src/redis.h +++ b/src/redis.h @@ -120,6 +120,7 @@ #define REDIS_DEFAULT_AOF_REWRITE_INCREMENTAL_FSYNC 1 #define REDIS_DEFAULT_MIN_SLAVES_TO_WRITE 0 #define REDIS_DEFAULT_MIN_SLAVES_MAX_LAG 10 +#define REDIS_IP_STR_LEN INET6_ADDRSTRLEN #define REDIS_BINDADDR_MAX 16 /* Protocol and I/O related defines */