[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #15518 [Core Tor/Tor]: Tor considers routers in the same IPv6 /16 to be "in the same subnet"



#15518: Tor considers routers in the same IPv6 /16 to be "in the same subnet"
-------------------------------------------------+-------------------------
 Reporter:  isis                                 |          Owner:  (none)
     Type:  defect                               |         Status:  new
 Priority:  High                                 |      Milestone:  Tor:
                                                 |  unspecified
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  ipv6, path, path-bias, tor-client    |  Actual Points:
  easy                                           |
Parent ID:  #24393                               |         Points:  1
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by aruna1234):

 I found tor_addr_compare and tor_addr_compare_masked in address.h which
 compares the address:

 int tor_addr_compare(const tor_addr_t *addr1, const tor_addr_t *addr2,
                      tor_addr_comparison_t how);
 int tor_addr_compare_masked(const tor_addr_t *addr1, const tor_addr_t
 *addr2,
                             maskbits_t mask, tor_addr_comparison_t how);
 I also came across this snippet in address.c which is below. Is the the
 block of code which compares for /16 i.e IPv4?
 case AF_INET: {
         uint32_t a1 = tor_addr_to_ipv4h(addr1);
         uint32_t a2 = tor_addr_to_ipv4h(addr2);
         if (mbits <= 0)
           return 0;
         if (mbits > 32)
           mbits = 32;
         a1 >>= (32-mbits);
         a2 >>= (32-mbits);
         r = TRISTATE(a1, a2);
         return r;
       }

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/15518#comment:26>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs