[tor-bugs] #33618 [Core Tor/Tor]: Add IPv6 Support to is_local_addr()

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Mar 14 17:55:47 UTC 2020


#33618: Add IPv6 Support to is_local_addr()
---------------------------------+------------------------
 Reporter:  kimimaro             |          Owner:  (none)
     Type:  enhancement          |         Status:  new
 Priority:  Medium               |      Milestone:
Component:  Core Tor/Tor         |        Version:
 Severity:  Normal               |     Resolution:
 Keywords:  outreachy-ipv6 ipv6  |  Actual Points:
Parent ID:                       |         Points:
 Reviewer:                       |        Sponsor:
---------------------------------+------------------------

Comment (by kimimaro):

 teor said that we should use tor_addr_compare_masked(). Here is the
 definition:
 {{{
 int
 tor_addr_compare_masked(const tor_addr_t *addr1, const tor_addr_t *addr2,
                         maskbits_t mbits, tor_addr_comparison_t how)
 }}}
 I assume we check the first 48 bits (so that's the third argument), and
 use CMP_EXACT (fourth argument).

 {{{is_local_addr()}}} already takes in an address pointer, which gives us
 the address we are checking. Now we need the IPv6 address of the local
 system (that would be the second argument). How exactly can I get that?

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


More information about the tor-bugs mailing list