[tor-bugs] #6876 [Tor Relay]: Add config option OutboundBindAddressIPv6

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Thu Sep 27 14:55:08 UTC 2012


#6876: Add config option OutboundBindAddressIPv6
-------------------------+--------------------------------------------------
 Reporter:  ln5          |          Owner:                    
     Type:  enhancement  |         Status:  needs_review      
 Priority:  normal       |      Milestone:  Tor: 0.2.4.x-final
Component:  Tor Relay    |        Version:                    
 Keywords:  ipv6         |         Parent:                    
   Points:               |   Actualpoints:                    
-------------------------+--------------------------------------------------
Changes (by ln5):

  * status:  needs_revision => needs_review


Comment:

 Replying to [comment:8 nickm]:
 > Looks mostly okay.  I think the memset() is wrong: there should be a
 tor_addr_make_null() function instead. I'll write one of those.

 I think the memset() is OK thanks to

 {{{
 /* tor_addr_is_null() and maybe other functions rely on AF_UNSPEC being 0
 to
  * work correctly. Bail out here if we've found a platform where AF_UNSPEC
  * isn't 0. */
 #if AF_UNSPEC != 0
 #error We rely on AF_UNSPEC being 0. Let us know about your platform,
 please!
 #endif
 }}}

 That said, I actually looked for a tor_addr_make_null() before
 settling for memset(). I guess I should've written one.


 > The "if (ext_addr)" test in connection_connect() will always be true: it
 should probably use "tor_addr_is_null()" instead?

 No, ext_addr will be NULL in some cases.

 {{{
     const tor_addr_t *ext_addr = NULL;
     if (protocol_family == AF_INET &&
         !tor_addr_is_null(&options->_OutboundBindAddressIPv4))
       ext_addr = &options->_OutboundBindAddressIPv4;
     else if (protocol_family == AF_INET6 &&
              !tor_addr_is_null(&options->_OutboundBindAddressIPv6))
       ext_addr = &options->_OutboundBindAddressIPv6;
 }}}

 I can move the code from the "if (ext_addr)" block into a separate
 function and call that from the if clauses above if you think that'd
 be better.

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


More information about the tor-bugs mailing list