OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Subject: Re: how to bind smtp client to specific address?
From: Greg Stark (gsstarkmit.edu)
Date: Sat Apr 01 2000 - 10:41:00 CST


Bennett Todd <betrahul.net> writes:

> 2000-03-30-15:44:20 Christopher E. Brown:
> > See previous mentions of iproute2. THERE ARE NO MULTIPLE
> > INTERFACES.
> >
> > You can use ip to assugn multiple IPs the the interface,
> > and if you with you can assign a label to each addidional address
> > (such as eth0:0) for backwards compat.
>
> An interface can have one or more addresses associated with it, they are all
> equal.

There seems to be some confusion here because there are two meanings of
"interface". The OS has an object called an interface, and linux is free to
come up with this strange interpretation of what that object is, but the
network has a concept of an interface as well. And the network concept
considers each address a separate interface.

It doesn't really matter what linux considers its interfaces for purposes of
this discussion. The important fact is that linux is not implementing the
bind(2) system call correctly. The program has called bind(2) with a
particular "interface" and by that I mean a particular address on the network,
and the OS has happily sent it out with a different source address.

There also appears to be some confusion here between the source address and
the routing table. The routing table does not determine what source address is
used, only which interface the packet is sent out on. It's entirely possible
for a socket bound to one interface to send packets with that source address
out on the other interface if the routing table says that's the best route to
the destination.

I find it really hard to believe these posters that linux's network stack is
this broken in this regard. Each alias really has to be considered a distinct
interfae for purposes of the userland tcp/ip interface, otherwise all sorts of
things will break. Not doing so would violate dozens of specifications all
over the place.

Incidentally this seems like a really painful interface, what if you want a
different MTU or even a different MAC address for that matter for each alias.
Is there also a provision for setting up real virtual interfaces as well?

-- 
greg