Why not using SO_REUSEADDR on Unix TCP/IP servers? Why not using SO_REUSEADDR on Unix TCP/IP servers? unix unix

Why not using SO_REUSEADDR on Unix TCP/IP servers?


Well, UNP (Stevens 2004) says:

SO_REUSEADDR allows a listening server to start and bind its well-known port, even if previously established connections exist that use this port as their local port.

All TCP servers should specify this socket option to allow the server to be restarted


Of course there is a very valid reason for not using SO_REUSEADDR by default.

It would allow ANY process to bind to the same listening socket as a sensitive Internet service and accept connections on its behalf! That permits unlimited eavesdropping and man-in-the-middling.