Re: Can We Agree on How to Fix SO_REUSEADDR?

Andi Kleen (ak@muc.de)
15 Feb 1999 18:48:24 +0100


In article <199902150817.AAA11969@eclipse.faximum.com>,
George.Pajari@faximum.com (George Pajari) writes:

> Conversely, if the system has n IP addresses (n > 1) then one ought to be
> able to have one process listening on port X with INADDR_ANY and up to n-1
> processes listening on the same port X but not using INADDR_ANY.
> Unfortunately, this case is not currently supported and it is this case I
> want to fix.

I don't think it is reasonable. If you want your application to only bind
to some addresses (like the "limited INADDR_ANY" you propose) you should
change the application to bind to all addresses it is interested in.
Also adding special cases for single or multiple IP systems is a bad kludge,
because it violates the principle of least astonishment. Allowing other
applications to steal packets is not acceptable, no matter how many IPs
anyways.

> But before I start putting together an actual kernel patch I want to see if
> there are any cases that need to be considered or other opinions on how
> SO_REUSEADDR support ought to be designed.

Don't change the meaning of INADDR_ANY. If an application does not want
INADDR_ANY it should not use it (but bind explicitely to the IP addresses
it wants instead). But if it asked for INADDR_ANY it should get it, without
any trapdoors.

-Andi

-- 
This is like TV. I don't like TV.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/