lkml.org 
[lkml]   [2001]   [Sep]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip alias bug 2.4.9 and 2.2.19]
On Thu, Sep 06, 2001 at 01:39:48PM -0400, Wietse Venema wrote:
> Andrey Savochkin:
> > > That is not practical. Surely there is an API to find out if an IP
> > > address connects to the machine itself. If every UNIX system on
> > > this planet can do it, then surely Linux can do it.
> >
> > Let me correct you: you need to recognize not addresses that result in
> > connecting to the _machine_ itself, but connecting to the same _MTA_.
>
> The SMTP RFC requires that user@[ip.address] is correctly recognized
> as a final destination. This requires that Linux provides the MTA
> with information about IP addresses that correspond with INADDR_ANY.

[ This is one of (at least) three different things that
have been mentioned in this thread, but lets limit
into only this one thing in this email ... ]


Why that needs a list of all addresses in the system ?

Reception can query with standard BSD API what is
the local address of the socket _at_the_moment_ at
receiving side. ( getsockname() )

Is there, really, any reason to detect locally anything else ?
At the receiver all you do is to detect that the IP address
literal matches the incoming connection, and you strip away
the literal.


Of course if the connection is coming in via some NAT box
somewhere causing your SMTP server to show up with other
address than what it knows about itself, things get complicated,
and no matter of what you code into automagic self-address
detection, you won't get that case solved with it.


> I am susprised that it is not possible to ask such information up
> front (same with netmasks), and that an application has to actually
> query a complex oracle, again and again, for every IP address.

Of course it can be asked for, and ZMailer does it all
the time when it considers contacting remote servers.
If IP address of the remote server appears to be any
of the local ones (or an invalidone), the message gets
rejected with "a configuration error detected, this
must be looping"...

> Wietse

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

\
 
 \ /
  Last update: 2005-03-22 13:17    [W:0.173 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site