lkml.org 
[lkml]   [2001]   [Sep]   [7]   [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]
H. Peter Anvin wrote:
> In autofs, I use the following technique to determine if the IP number
> for a host is local (and therefore vfsbinds can be used rather than
> NFS mounts):
>
> 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.

Nice. Gives false negatives in some cases (e.g. a local tunnel) but
that doesn't really matter.

I've considered this technique for deciding whether it's safe to use the
MIT-SHM extension with X:

Open a SHM segment; write fairly secure random data into it; ask the X
server to connect to that segment and read it back as an image over the
X protocol; check whether they match.

If the X server reports an error, it's remote. If it finds a SHM
segment it may still be remote, hence the random data check.

-- Jamie
-
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:02    [W:0.152 / U:23.128 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site