[1858] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Re: Multi-homed hosts

daemon@ATHENA.MIT.EDU (Olaf Titz)
Mon Feb 5 21:43:16 1996

To: submit-linux-dev-net@ratatosk.yggdrasil.com
From: Olaf Titz <olaf@bigred.inka.de>
Date: 	05 Feb 1996 16:17:13 +0000

Matthias Urlichs  <smurf@smurf.noris.de> wrote:
> Fine, I think, there is an easy solution: hack bind() to replace INADDR_ANY
> with the contents of the BIND_INADDR environment variable (if any).

Neat idea. Would save me some patches in often-needed software too...

> Problem: Outgoing, you don't usually call bind() at all. Easy solution:
> bind(..,INADDR_ANY) when creating a new IP socket.

I'd rather like to put the hack in connect() and listen() for TCP sockets.
These are the functions that will do the implicit bind in the kernel
if not bound explicitly (AFAIK, but that's the logical sequence).
(As for listen(), this is for applications which listen on a new port
and tell the other end over a signaling channel the port number.)

For UDP, this is more problematic. Off-hand, I don't see an easy
solution.

> Problem: The kernel doesn't like two bind() calls in a row. Why not??? BSD
> handles that fine, as far as I know, as long as there's no connection on
> the socket. Removing the appropriate check from the kernel doesn't brerak
> anything...

Right, re-binding should be allowed without getting into any trouble.

olaf
-- 
___        Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de       ____
__ o           <URL:http://www.inka.de/~bigred/>     <IRC:praetorius>
__/<_              >> Just as long as the wheels keep on turning round
_)>(_)______________ I will live for the groove 'til the sun goes down << ____


home help back first fref pref prev next nref lref last post