[1828] in linux-net channel archive

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

Miulti-homed hosts

daemon@ATHENA.MIT.EDU (Matthias Urlichs)
Sat Feb 3 17:11:11 1996

From: Matthias Urlichs <smurf@smurf.noris.de>
To: linux-net@vger.rutgers.edu
Date: 	Sat, 3 Feb 1996 18:59:13 +0100

Hi,

if I really want to have multiple IP numbers for a host, I must be able=
 to
specify the IP number to bind to (incoming and outgoing).

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).

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

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 o=
n
the socket. Removing the appropriate check from the kernel doesn't brer=
ak
anything...

Problem: the portmapper. It seems that the stupid beast first binds to
port 111 and then, in rpc_svcudp() or whatever, calls bindresvport(), w=
hich
doesn't check whether the port is bound already. Grumble. With the earl=
ier
kernel, the second call of course failed.

Problem: The modified kernel won't work with an unmodified libc, becaus=
e of
the portmapper.  :-(  I DO NOT want to run with privately-modified kern=
els
and libraries indefinitely, thus the question: Do you think those chang=
es
are reasonable? Any other problems you see with this?=20

I initially wanted to just LD_PRELOAD a small library with the "special=
"
code, but that didn't work for my application (Netnews. "inndstart" is
setuid(root) so that it can bind to port 119.)

Any further ideas are appreciated.

--=20
The accessibility of a small part which has fallen behind the workbench=
 is
directly proportional to its size and inversely proportional to its
importance.
--=20
Matthias Urlichs        \ XLink-POP N=FCrnberg  | EMail: urlichs@smurf.=
noris.de
Schleiermacherstra=DFe 12  \  Unix+Linux+Mac    | Phone: ...please use =
email.
90491 N=FCrnberg (Germany)  \   Consulting+Networking+Programming+etc'i=
ng     42
          PGP: 1B 89 E2 1C 43 EA 80 44  15 D2 29 CF C6 C7 E0 DE=20
       Click <A HREF=3D"http://smurf.noris.de/~smurf/finger">here</A>.


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