From 7e9433cee16364f9352cc95f36fbad056eadd964 Mon Sep 17 00:00:00 2001 From: antirez Date: Mon, 23 Dec 2013 11:31:35 +0100 Subject: [PATCH] Configuring port to 0 disables IP socket as specified. This was no longer the case with 2.8 becuase of a bug introduced with the IPv6 support. Now it is fixed. This fixes issue #1287 and #1477. --- src/redis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/redis.c b/src/redis.c index 98a6f67a..e926e9c8 100644 --- a/src/redis.c +++ b/src/redis.c @@ -1593,7 +1593,8 @@ void initServer() { server.db = zmalloc(sizeof(redisDb)*server.dbnum); /* Open the TCP listening socket for the user commands. */ - if (listenToPort(server.port,server.ipfd,&server.ipfd_count) == REDIS_ERR) + if (server.port != 0 && + listenToPort(server.port,server.ipfd,&server.ipfd_count) == REDIS_ERR) exit(1); /* Open the listening Unix domain socket. */