Skip to content
  • David Goulet's avatar
    client: Revert setting PreferIPv6 on by default · cd2121a1
    David Goulet authored and teor's avatar teor committed
    
    
    This change broke torsocks that by default is expecting an IPv4 for hostname
    resolution because it can't ask tor for a specific IP version with the SOCKS5
    extension.
    
    PreferIPv6 made it that sometimes the IPv6 could be returned to torsocks that
    was expecting an IPv4.
    
    Torsocks is probably a very unique case because the runtime flow is that it
    hijacks DNS resolution (ex: getaddrinfo()), gets an IP and then sends it back
    for the connect() to happen.
    
    The libc has DNS resolution functions that allows the caller to request a
    specific INET family but torsocks can't tell tor to resolve the hostname only
    to an IPv4 or IPv6 and thus by default fallsback to IPv4.
    
    Reverting this change into 0.4.3.x series but we'll keep it in the 0.4.4.x
    series in the hope that we add this SOCKS5 extension to tor for DNS resolution
    and then change torsocks to use that.
    
    Fixes #33804
    
    Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
    cd2121a1