1. 11 Jul, 2013 27 commits
    • antirez's avatar
      getClientPeerID introduced. · 4fa68b28
      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.
      4fa68b28
    • antirez's avatar
      a7451c1b
    • antirez's avatar
      IPv6: bind IPv4 and IPv6 interfaces by default. · 2e75d394
      antirez authored
      2e75d394
    • antirez's avatar
      b5423b09
    • antirez's avatar
      Revert "Document port6 and bind6 config options." · 1e794922
      antirez authored
      IPv6 support is not going to use IPv6 specific options, just it will be
      possible to specify all the ipv4 / ipv6 addresses of the interfaces to
      bind, otherwise connections will be accepted from all the interfaces in
      both IPv4 and IPv6 addresses.
      
      This reverts commit 93570e17.
      1e794922
    • Geoff Garside's avatar
      Add IPv6 support to sentinel.c. · 0d8f2543
      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.
      0d8f2543
    • Geoff Garside's avatar
    • Geoff Garside's avatar
      d3bf8542
    • Geoff Garside's avatar
      Document port6 and bind6 config options. · 47620a31
      Geoff Garside authored
      Add commented port6 and bind6 options to default redis.conf file.
      47620a31
    • Geoff Garside's avatar
      Add anetTcp6Server() function. · fd8a6ae7
      Geoff Garside authored
      Refactor the common code from anetTcpServer into internal function which
      can be used by both anetTcpServer and anetTcp6Server.
      fd8a6ae7
    • Geoff Garside's avatar
      Add static anetV6Only() function. · f6382369
      Geoff Garside authored
      This function sets the IPV6_V6ONLY option to 1 to use separate stack
      IPv6 sockets.
      f6382369
    • Geoff Garside's avatar
      Change anetTcpGenericConnect to use AF_UNSPEC. · 71795d4e
      Geoff Garside authored
      This allows anetTcpGenericConnect to try to connect to AF_INET6
      addresses in addition to any resolved AF_INET addresses.
      71795d4e
    • Geoff Garside's avatar
      Mark places that might want changing for IPv6. · d37d006c
      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.
      d37d006c
    • Geoff Garside's avatar
      Expand ip char buffers which are too small for v6. · 57e2b23d
      Geoff Garside authored
      Increase the size of character buffers being used to store printable IP
      addresses so that they can safely store IPv6 addresses.
      57e2b23d
    • Geoff Garside's avatar
      Mark ip string buffers which could be reduced. · 39d57c05
      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.
      39d57c05
    • Geoff Garside's avatar
      Update anetPeerToString to handle AF_INET6 addrs. · f1151f86
      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.
      f1151f86
    • Geoff Garside's avatar
      Update anetTcpAccept to handle AF_INET6 addresses. · fefa1491
      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.
      fefa1491
    • Geoff Garside's avatar
      Update anetResolve to resolve AF_INET6 as well. · 77ddec85
      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.
      77ddec85
    • Geoff Garside's avatar
      4b2e374e
    • Geoff Garside's avatar
      3570411d
    • Geoff Garside's avatar
      Add macro to define clusterNode.ip buffer size. · 68d72aa5
      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.
      68d72aa5
    • Geoff Garside's avatar
      Update anetTcpAccept & anetPeerToString calls. · 30836721
      Geoff Garside authored
      Add the additional ip buffer length argument to function calls of
      anetTcpAccept and anetPeerToString in network.c and cluster.c
      30836721
    • Geoff Garside's avatar
      Use inet_ntop(3) in anet. #apichange · 920ab4c9
      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.
      920ab4c9
    • Geoff Garside's avatar
      Use getaddrinfo(3) in a anetTcpServer. · aee5ee70
      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.
      aee5ee70
    • Geoff Garside's avatar
      Use getaddrinfo(3) in anetTcpGenericConnect. · e50f2c93
      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.
      e50f2c93
    • Geoff Garside's avatar
      Add anetSetReuseAddr(err, fd) static function. · d36dc1fc
      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.
      d36dc1fc
    • Geoff Garside's avatar
      Use getaddrinfo(3) in anetResolve. #apichange · 855ff8df
      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.
      855ff8df
  2. 08 Jul, 2013 7 commits
  3. 03 Jul, 2013 2 commits
    • antirez's avatar
      redis-cli: introduced --pipe-timeout. · 3e350126
      antirez authored
      When in --pipe mode, after all the data transfer to the server is
      complete, now redis-cli waits at max the specified amount of
      seconds (30 by default, use 0 to wait forever) without receiving any
      reply at all from the server. After this time limit the operation is
      aborted with an error.
      
      That's related to issue #681.
      3e350126
    • antirez's avatar
      redis-cli --pipe: send final ECHO in a safer way. · 24b37992
      antirez authored
      If the protocol read from stdin happened to contain grabage (invalid
      random chars), in the previous implementation it was possible to end
      with something like:
      
      dksfjdksjflskfjl*2\r\n$4\r\nECHO....
      
      That is invalid as the *2 should start into a new line. Now we prefix
      the ECHO with a CRLF that has no effects on the server but prevents this
      issues most of the times.
      
      Of course if the offending wrong sequence is something like:
      
      $3248772349\r\n
      
      No one is going to save us as Redis will wait for data in the context of
      a big argument, so this fix does not cover all the cases.
      
      This partially fixes issue #681.
      24b37992
  4. 02 Jul, 2013 4 commits