• 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
anet.c 14 KB