- 09 Jul, 2013 4 commits
-
-
antirez authored
We now also use it in CLIENT KILL implementation.
-
antirez authored
The function returns an unique identifier for the client, as ip:port for IPv4 and IPv6 clients, or as path:0 for Unix socket clients. See the top comment in the function for more info.
-
antirez authored
-
antirez authored
-
- 08 Jul, 2013 32 commits
-
-
antirez authored
-
Geoff Garside authored
This has been done by exposing the anetSockName() function anet.c to be used when the sentinel is publishing its existence to the masters. This implementation is very unintelligent as it will likely break if used with IPv6 as the nested colons will break any parsing of the PUBLISH string by the master.
-
Geoff Garside authored
-
Geoff Garside authored
-
Geoff Garside authored
Add commented port6 and bind6 options to default redis.conf file.
-
Geoff Garside authored
Refactor the common code from anetTcpServer into internal function which can be used by both anetTcpServer and anetTcp6Server.
-
Geoff Garside authored
This function sets the IPV6_V6ONLY option to 1 to use separate stack IPv6 sockets.
-
Geoff Garside authored
This allows anetTcpGenericConnect to try to connect to AF_INET6 addresses in addition to any resolved AF_INET addresses.
-
Geoff Garside authored
Any places which I feel might want to be updated to work differently with IPv6 have been marked with a comment starting "IPV6:". Currently the only comments address places where an IP address is combined with a port using the standard : separated form. These may want to be changed when printing IPv6 addresses to wrap the address in [] such as [2001:db8::c0:ffee]:6379 instead of 2001:db8::c0:ffee:6379 as the latter format is a technically valid IPv6 address and it is hard to distinguish the IPv6 address component from the port unless you know the port is supposed to be there.
-
Geoff Garside authored
Increase the size of character buffers being used to store printable IP addresses so that they can safely store IPv6 addresses.
-
Geoff Garside authored
In two places buffers have been created with a size of 128 bytes which could be reduced to INET6_ADDRSTRLEN to still hold a full IP address. These places have been marked as they are presently big enough to handle the needs of storing a printable IPv6 address.
-
Geoff Garside authored
Changes the sockaddr_in to a sockaddr_storage. Attempts to convert the IP address into an AF_INET or AF_INET6 before returning an "Invalid IP address" error. Handles converting the sockaddr from either AF_INET or AF_INET6 back into a string for storage in the clusterNode ip field.
-
Geoff Garside authored
Change the sockaddr_in to sockaddr_storage which is capable of storing both AF_INET and AF_INET6 sockets. Uses the sockaddr_storage ss_family to correctly return the printable IP address and port. Function makes the assumption that the buffer is of at least REDIS_CLUSTER_IPLEN bytes in size.
-
Geoff Garside authored
Change REDIS_CLUSTER_IPLEN to INET6_ADDRSTRLEN so that the clusterNode ip character buffer is big enough to hold an IPv6 address.
-
Geoff Garside authored
Change the sockaddr_in to sockaddr_storage which is capable of storing both AF_INET and AF_INET6 sockets. Uses the sockaddr_storage ss_family to correctly return the printable IP address and port.
-
Geoff Garside authored
Change the sockaddr_in to sockaddr_storage which is capable of storing both AF_INET and AF_INET6 sockets. Uses the sockaddr_storage ss_family to correctly return the printable IP address and port.
-
Geoff Garside authored
Change the getaddrinfo(3) hints family from AF_INET to AF_UNSPEC to allow resolution of IPv6 addresses as well as IPv4 addresses. The function will return the IP address of whichever address family is preferenced by the operating system. Most current operating systems will preference AF_INET6 over AF_INET. Unfortunately without attempting to establish a connection to the remote address we can't know if the host is capable of using the returned IP address. It might be desirable to have anetResolve accept an additional argument specifying the AF_INET/AF_INET6 address the caller would like to receive. Currently though it does not appear as though the anetResolve function is ever used within Redis.
-
Geoff Garside authored
-
Geoff Garside authored
-
Geoff Garside authored
getpeername(2) requires <sys/socket.h> which on some systems also requires <sys/types.h>. Include both to avoid compilation warnings.
-
Geoff Garside authored
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 <netinet/in.h> header file and should be portable across the majority of systems.
-
Geoff Garside authored
Using sizeof with an array will only return expected results if the array is created in the scope of the function where sizeof is used. This commit changes the inet_ntop calls so that they use the fixed buffer value as defined in redis.h which is 16.
-
Geoff Garside authored
Replace inet_aton(3) call with the more future proof inet_pton(3) function which is capable of handling additional address families.
-
Geoff Garside authored
Replace inet_ntoa(3) calls with the more future proof inet_ntop(3) function which is capable of handling additional address families.
-
Geoff Garside authored
Add the additional ip buffer length argument to function calls of anetTcpAccept and anetPeerToString in network.c and cluster.c
-
Geoff Garside authored
Replace inet_ntoa(3) calls with the more future proof inet_ntop(3) function which is capable of handling additional address families. API Change: anetTcpAccept() & anetPeerToString() additional argument additional argument required to specify the length of the character buffer the IP address is written to in order to comply with inet_ntop(3) function semantics.
-
Geoff Garside authored
Change anetTcpServer() function to use getaddrinfo(3) to perform address resolution, socket creation and binding. Resolved addresses are limited to those reachable by the AF_INET address family.
-
Geoff Garside authored
Change anetTcpGenericConnect() function to use getaddrinfo(3) to perform address resolution, socket creation and connection. Resolved addresses are limited to those reachable by the AF_INET family.
-
Geoff Garside authored
Extract setting SO_REUSEADDR socket option into separate function so the same code can be more easily used by anetCreateSocket and other functions.
-
Geoff Garside authored
Change anetResolve() function to use getaddrinfo(3) to resolve hostnames. Resolved hostnames are limited to those reachable by the AF_INET address family. API Change: anetResolve requires additional argument. additional argument required to specify the length of the character buffer the IP address is written to in order to comply with inet_ntop(3) function semantics. inet_ntop(3) replaces inet_ntoa(3) as it has been designed to be compatible with more address families.
-
antirez authored
-
- 05 Jul, 2013 3 commits
-
-
antirez authored
-
- 04 Jul, 2013 1 commit
-
-
antirez authored
-