Re: bind() allowed to non-local addresses

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Thu Oct 19 2000 - 06:50:36 EST


Horst von Brand wrote:
> > > How about first finding out why their buggy JRE detects whether an
> > > address is local by trying to bind() to it :-)
>
> > I don't know why the JRE does it, but I've seen that sort of thing used
> > to decide whether to try X shared memory.
>
> Could you explain the logic behid that?!

(a) connect to DISPLAY
(b) ask for MIT-SHM extension; answer = yes
(c) create shared memory segment
(d) tell X server to open shared memory segment
(e) oops, X server connected to wrong segment on remote machine!

Checking for a local X connection was a buggy way to avoid that.

The right way, of course, is to fill your new SHM segment with some
random number, get the X server to connect, and read the contents over
the X connection to see if you and the server found the same SHM
segment.

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



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:14 EST