[tor-bugs] #17950 [Tor]: Make address family search more efficient

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Dec 29 12:05:00 UTC 2015


#17950: Make address family search more efficient
-----------------------------+--------------------------
     Reporter:  teor         |      Owner:
         Type:  enhancement  |     Status:  new
     Priority:  Medium       |  Milestone:  Tor: 0.2.???
    Component:  Tor          |    Version:
     Severity:  Normal       |   Keywords:  lorax easy
Actual Points:               |  Parent ID:
       Points:               |    Sponsor:
-----------------------------+--------------------------
 Tor searches local interfaces for IPv4/IPv6 addresses, but it often
 retrieves all addresses, then filters for IPv4/IPv6.

 We could make this more efficient for some of the interface address
 functions:
 * getifaddrs doesn't take an address family, but we can check the address
 families of the returned addresses
 * ioctl(.,SIOCGIFCONF,.) only supports AF_INET6 on AIX, or on HP-UX and
 Solaris with SIOCGLIFCONF, and otherwise only returns IPv4 addresses
 * GetAdaptersAddresses (Win32) takes an address family as its first
 argument
 * tor_getsockname/get_interface_address6_via_udp_socket_hack takes an
 address family as its first argument

 A design for this could be:
 * pass the address family to get_interface_addresses_raw
 * pass the address family to the API-specific functions that take an
 address family, or when converting the address to a smartlist,
 include/exclude addresses matching the specified address families

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17950>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list