[tor-bugs] #18460 [Tor]: Relays and bridges are not counting directory requests coming in via IPv6

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Mar 1 21:27:41 UTC 2016


#18460: Relays and bridges are not counting directory requests coming in via IPv6
-------------------------+----------------------------------
     Reporter:  karsten  |      Owner:
         Type:  defect   |     Status:  new
     Priority:  Medium   |  Milestone:  Tor: 0.2.6.x-final
    Component:  Tor      |    Version:  Tor: 0.2.8.1-alpha
     Severity:  Normal   |   Keywords:  tor-relay tor-bridge
Actual Points:           |  Parent ID:
       Points:           |    Sponsor:
-------------------------+----------------------------------
 While testing my #8786 branch I found that relays and bridges are
 currently not counting directory requests coming in via IPv6 at all.  The
 reason is the `if` in the following code snippet from
 `directory_handle_command_get()`:

 {{{
       struct in_addr in;
       tor_addr_t addr;
       if (tor_inet_aton((TO_CONN(conn))->address, &in)) {
         tor_addr_from_ipv4h(&addr, ntohl(in.s_addr));
         geoip_note_client_seen(GEOIP_CLIENT_NETWORKSTATUS,
                                &addr, NULL,
                                time(NULL));
 }}}

 `tor_inet_aton` expects an IPv4 address in dotted-quad notation and
 returns 0 if it's given an IPv6 address.

 When digging deeper into Git history, I found that I had changed that code
 to `&TO_CONN(conn)->addr` 4 years ago and then again to the code above in
 4741aa4 because "Roger notes that address and addr are two different
 things."

 I ''think'' this was a mistake and that we can fix this by just reverting
 4741aa4.  I'll post a branch in a minute that I tested using Chutney's
 "bridges+ipv6" network (together with teor's #17153 fix).

 Please correct me if we should really use `address` here instead of
 `addr`.  In that case we'll probably want to look if `address` contains an
 IPv6 address string and handle that separately.

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


More information about the tor-bugs mailing list