[tor-bugs] #2850 [Tor Relay]: use of SO_REUSEADDR socket option, was: Error binding network socket: Address already in use

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Mon Apr 4 21:15:25 UTC 2011


#2850: use of SO_REUSEADDR socket option, was: Error binding network socket:
Address already in use
-------------------------+--------------------------------------------------
 Reporter:  Falo         |          Owner:                     
     Type:  enhancement  |         Status:  new                
 Priority:  normal       |      Milestone:                     
Component:  Tor Relay    |        Version:  Tor: 0.2.2.23-alpha
 Keywords:               |         Parent:                     
   Points:               |   Actualpoints:                     
-------------------------+--------------------------------------------------
 Blutmagie and Tory exits frequently log the error
 Apr 04 15:27:48.706 [warn] Error binding network socket: Address already
 in use

 According to Roger's answer to my today's posting on tor-relays mailing
 list the SO_REUSEADDR socket option isn't used in all cases. It might be
 an idea to set this option in any case.

 === Roger's answer ===
 Actually, we only use SO_REUSEADDR when binding listening sockets. The
 errors you're seeing are likely because you can't open a new socket for an
 outbound connection. And we don't use SO_REUSEADDR when creating outbound
 sockets: see connection_connect().

 We also don't set SO_REUSEADDR on the new socket we make after receiving
 connections on a listening socket: see connection_handle_listener_read().

 I don't know what behavior to expect, but I would not be surprised to
 learn that we should set it in both of these cases too. Worth
 experimenting.

 --Roger

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


More information about the tor-bugs mailing list