Use inet_pton(3) in clusterCommand.

Replace inet_aton(3) call with the more future proof inet_pton(3)
function which is capable of handling additional address families.
This commit is contained in:
Geoff Garside 2011-06-17 20:37:45 +01:00 committed by antirez
parent a6ea707cec
commit 693b640510

View File

@ -2070,7 +2070,7 @@ void clusterCommand(redisClient *c) {
long port;
/* Perform sanity checks on IP/port */
if (inet_aton(c->argv[2]->ptr,&sa.sin_addr) == 0) {
if (inet_pton(AF_INET,c->argv[0]->ptr,&(sa.sin_addr)) == 0) {
addReplyError(c,"Invalid IP address in MEET");
return;
}