[tor-bugs] #9309 [Tor]: broken canonical connection detection in channel_matches_target_addr_for_extend()

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jul 23 09:37:30 UTC 2013


#9309: broken canonical connection detection in
channel_matches_target_addr_for_extend()
--------------------------------+-------------------------------------------
 Reporter:  asn                 |          Owner:                    
     Type:  defect              |         Status:  new               
 Priority:  major               |      Milestone:  Tor: 0.2.4.x-final
Component:  Tor                 |        Version:                    
 Keywords:  tor-client channel  |         Parent:                    
   Points:                      |   Actualpoints:                    
--------------------------------+-------------------------------------------
Changes (by nickm):

  * priority:  normal => major


Comment:

 This one, however, seems right:

 0.2.4:
 {{{
     if (chan->state != CHANNEL_STATE_OPEN) {
       /* If the address matches, don't launch a new connection for this
        * circuit. */
       if (!channel_matches_target_addr_for_extend(chan, target_addr))
         ++n_inprogress_goodaddr;
       continue;
     }
 }}}

 0.2.3:
 {{{
     if (conn->_base.state != OR_CONN_STATE_OPEN) {
       /* If the address matches, don't launch a new connection for this
        * circuit. */
       if (!tor_addr_compare(&conn->real_addr, target_addr, CMP_EXACT))
         ++n_inprogress_goodaddr;
       continue;
     }
 }}}

 My recommendation is that "matches" should return !tor_addr-compare(),
 that the function documentation should say "Return true iff..." (i.e.,
 describe the return value).  The n_noncanonical case should say !matches;
 the n_inprogress_goodaddr case should say "matches".

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


More information about the tor-bugs mailing list