[tor-bugs] #6816 [Tor Relay]: {connection_or, channel}_flush_from_first_active_circuit() should pick a new circuit for each cell

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Wed Sep 12 00:41:57 UTC 2012


#6816: {connection_or,channel}_flush_from_first_active_circuit() should pick a new
circuit for each cell
-----------------------+----------------------------------------------------
 Reporter:  andrea     |          Owner:                    
     Type:  defect     |         Status:  new               
 Priority:  normal     |      Milestone:  Tor: 0.2.4.x-final
Component:  Tor Relay  |        Version:  Tor: 0.2.4.2-alpha
 Keywords:             |         Parent:                    
   Points:             |   Actualpoints:                    
-----------------------+----------------------------------------------------
 Before channels, this function was always called with max == 1; during the
 course of testing channels I discovered that it is broken with max > 1.

 We pick cell_ewma once per invocation:

 https://gitweb.torproject.org/tor.git/blob/75c9ccd4f851bac6d32cb08ded557ac207bc8002:/src/or/relay.c#l2412

 Then once per cell, we pop the head of the pqueue and re-add it (to get it
 to its new correct position):

 https://gitweb.torproject.org/tor.git/blob/75c9ccd4f851bac6d32cb08ded557ac207bc8002:/src/or/relay.c#l2479

 ... but if the new position is not the head of the queue, we don't change
 cell_ewma and we continue sending from the same circuit - and then the
 assert fails the next time around.

 This function should be refactored to not do this and to separate the
 policy choice of what priority order to impose on circuits from the
 mechanism of picking a circuit, pulling cells off it and sending them down
 the wire.

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


More information about the tor-bugs mailing list