public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip aliasbug 2.4.9 and 2.2.19]
@ 2001-09-07 10:10 Julian Anastasov
  2001-09-07  7:54 ` Andrey Savochkin
  0 siblings, 1 reply; 69+ messages in thread
From: Julian Anastasov @ 2001-09-07 10:10 UTC (permalink / raw)
  To: Andrey Savochkin; +Cc: Wietse Venema, Matthias Andree, linux-kernel


	Hello,

Andrey Savochkin wrote:

> > > connect a datagram socket (which won't produce any actual traffic) to
> > > the remote host with INADDR_ANY as the local address, and then query
> > > the local address.  If the local address is the same as the remote
> > > address, the address is local.
> >
> > That will always work, even when you have multiple ethernet
> > interfaces??
>
> It will work almost always, except cases where administrator set different
> preffered sources in local routes.

	It seems if connect() is called without bind() and the target
is local address the selected source is the same (the preferred address
is not used). The postfix guys simply can try this proposal (I don't
know whether they tried it already). I don't expect netfilter to make
loops by connecting the both ends on same host, so such solution can
return the best actual result that is possible at the time of the request.
Any assumptions on daemon start what are the local IP addresses can be
wrong for some strange setups.

	May be someone can check whether this is a portable way to
check whether one IP is local. [We know that bind() to IP is not such
solution, at least in Linux]. If this is true, I think, it is better than
using ioctls or talking rtnetlink.

	As for the "local networks" there is no such thing. There are
trusted and non-trusted networks, gatewayed and non-gatewayed, etc. So, it
should be a user-defined setting, if used somehow at all.

> I.e. it is indeed a very good approximation, but autofs shouldn't still hang
> or do nasty things if the check with the datagram socket shows that address
> isn't local, but in reality it happens to be local.
> A subtle misbehavior or loss of efficiency are acceptable, in my opinion.

Regards

--
Julian Anastasov <ja@ssi.bg>


^ permalink raw reply	[flat|nested] 69+ messages in thread

end of thread, other threads:[~2001-09-17 21:39 UTC | newest]

Thread overview: 69+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20010905170037.A6473@emma1.emma.line.org.suse.lists.linux.kernel>
     [not found] ` <20010905152738.C5912BC06D@spike.porcupine.org.suse.lists.linux.kernel>
     [not found]   ` <20010905182033.D3926@emma1.emma.line.org.suse.lists.linux.kernel>
2001-09-05 19:26     ` ioctl SIOCGIFNETMASK: ip alias bug 2.4.9 and 2.2.19 Andi Kleen
2001-09-06 13:11       ` Matthias Andree
2001-09-06 13:35       ` Andrey Savochkin
2001-09-06 14:04         ` Wietse Venema
2001-09-06 14:21           ` Matthias Andree
2001-09-06 15:37             ` notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip alias bug 2.4.9 and 2.2.19] Andrey Savochkin
2001-09-06 15:58               ` Wietse Venema
2001-09-06 16:39                 ` notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip alias Alan Cox
2001-09-06 16:45                   ` Wietse Venema
2001-09-06 16:44                 ` notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip alias bug 2.4.9 and 2.2.19] Andrey Savochkin
2001-09-06 16:47                   ` Andi Kleen
2001-09-06 17:04                     ` Andrey Savochkin
2001-09-06 16:50                   ` Wietse Venema
2001-09-06 17:01                     ` notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip alias Alan Cox
2001-09-06 17:23                       ` Wietse Venema
2001-09-06 17:45                         ` Charles Cazabon
2001-09-06 18:11                         ` Steve VanDevender
2001-09-06 18:25                           ` Wietse Venema
2001-09-06 19:10                             ` Steve VanDevender
2001-09-06 19:47                             ` Alan Cox
2001-09-06 20:16                               ` Wietse Venema
2001-09-06 19:34                         ` Alan Cox
2001-09-06 19:41                           ` Wietse Venema
2001-09-06 20:18                             ` Alan Cox
2001-09-06 20:11                           ` Matthias Andree
2001-09-06 20:23                             ` Alan Cox
2001-09-06 20:31                               ` Andi Kleen
2001-09-06 20:52                                 ` Matthias Andree
2001-09-07  9:06                             ` Henning P. Schmiedehausen
2001-09-07  8:52                         ` Matthew Kirkwood
2001-09-08 16:31                           ` Wietse Venema
2001-09-13 14:35                       ` Pavel Machek
2001-09-06 17:03                     ` notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip alias bug 2.4.9 and 2.2.19] Andi Kleen
2001-09-06 17:23                     ` Andrey Savochkin
2001-09-06 17:39                       ` Wietse Venema
2001-09-06 18:23                         ` H. Peter Anvin
2001-09-07  1:47                           ` Jamie Lokier
2001-09-07  5:48                           ` notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip aliasbug " Ben Greear
2001-09-07  5:50                             ` H. Peter Anvin
2001-09-17 21:39                               ` Ben Greear
2001-09-07  6:26                             ` Andrey Savochkin
2001-09-07  6:21                               ` H. Peter Anvin
2001-09-06 19:15                         ` notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip alias bug " dean gaudet
2001-09-06 19:33                           ` Wietse Venema
2001-09-06 20:51                         ` Matti Aarnio
2001-09-07  7:29                           ` Andrey Savochkin
2001-09-07  7:35                             ` Matthias Andree
2001-09-08 13:16                             ` notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip alias Kai Henningsen
2001-09-07 10:30                         ` notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip alias bug 2.4.9 and 2.2.19] Mike Jagdis
2001-09-07 11:04                           ` Matthias Andree
2001-09-07 15:34                         ` Kurt Roeckx
2001-09-06 18:20                 ` H. Peter Anvin
2001-09-06 16:01               ` Matthias Andree
2001-09-06 16:38                 ` Andrey Savochkin
2001-09-06 16:43                   ` Wietse Venema
2001-09-06 17:03                     ` Charles Cazabon
2001-09-06 17:05                   ` Alex Bligh - linux-kernel
2001-09-06 17:37                     ` Andrey Savochkin
2001-09-06 17:55               ` kuznet
2001-09-06 14:51           ` ioctl SIOCGIFNETMASK: ip alias bug 2.4.9 and 2.2.19 Alan Cox
2001-09-06 14:17         ` Matthias Andree
2001-09-08 12:42       ` Kai Henningsen
2001-09-09  0:37         ` Matthias Andree
2001-09-07 10:10 notion of a local address [was: Re: ioctl SIOCGIFNETMASK: ip aliasbug 2.4.9 and 2.2.19] Julian Anastasov
2001-09-07  7:54 ` Andrey Savochkin
2001-09-07 11:09   ` Julian Anastasov
2001-09-07  8:42     ` Andrey Savochkin
2001-09-07 12:08       ` Julian Anastasov
2001-09-07 16:39       ` Christopher Friesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox