[Spread-users] INET unable to bind to port - force kill?

Marc ZYNGIER mzyngier at freesurf.fr
Wed Aug 1 03:39:49 EDT 2001

>>>>> "JS" == Jonathan Stanton <jonathan at cnds.jhu.edu> writes:

JS> If the server had used RESUEADDR then a second copy of the server
JS> (or ANY other program) could bind to port 5555 after the server
JS> had started and it is not well defined who would get the data that
JS> is sent to port 5555 (maybe one program maybe both).

I'm afraid you're wrong here. Multiple bind and data delivery have
quite clearly defined semantics :

With or without SO_REUSEADDR, you cannot bind twice to the same
interface (ip address). SO_REUSEADDR allows you to bind to the same
port, using a different ip address. Each socket gets the traffic
directed to the ip address it is bound to. Broadcasts are received on
both. A socket bound to INADDR_ANY acts as a 'garbage collector' for
data directed to ip addresses nobody is explicitly bound to.

You can say 'security hole' if you use SO_REUSEADDR *and* bind to
INADDR_ANY. That's the only way your traffic can be stolen. The right
way to do this IMHO is to bind to a specific ip address. I use this on
quite a lot of systems...

I personnaly run multiple Spread instances on my systems, one instance
per network interface. SO_REUSEADDR is quite mandatory in this case
(and yes, I want all of them to run on the same tcp port).

Hope I've been clear enough :-). I'd appreciate any comment on the

Sincerly yours,

Places change, faces change. Life is so very strange.

More information about the Spread-users mailing list