[tor-bugs] #22739 [Core Tor/Tor]: Make routerinfo_t and routerstatus_t addresses immutable; store overrides in node_t

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Jun 27 23:36:46 UTC 2017


#22739: Make routerinfo_t and routerstatus_t addresses immutable; store overrides
in node_t
------------------------------+--------------------------------
     Reporter:  nickm         |      Owner:
         Type:  defect        |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.2.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 See this comment in `rewrite_node_address_for_bridge`:
 {{{
   /* XXXX overridden addresses should really live in the node_t, so that
 the
    *   routerinfo_t and the microdesc_t can be immutable.  But we can only
    *   do that safely if we know that no function that connects to an OR
    *   does so through an address from any source other than
 node_get_addr().
    */
 }}}

 Here's how we can do that, in several phases.

 1) Add an "override orport" tor_addrport_t in node_t which, if set,
 overrides the advertised ports.  Make rewrite_node_address_for_bridge()
 overrwrite that in addition to the stuff it already overwrites.

 2) Make the various node_get*_addr() look at that field.

 3) Rename ri->addr, ri->*port, md->addr, and md->*port, possibly combining
 them to use the tor_addrport_t structure.  This will break everything that
 uses them. As we fix those compilation errors, make sure that everything
 using them to decide where to connect uses node_get*_addr() instead --
 specifically, one of the functions modified in 2 above.

 4) Remove the extra logic in rewrite_node_address_for_bridge().

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


More information about the tor-bugs mailing list