Re: bind() allowed to non-local addresses

From: H. Peter Anvin (hpa@zytor.com)
Date: Wed Oct 18 2000 - 22:51:13 EST


Followup to: <200010182316.QAA20282@pizda.ninka.net>
By author: "David S. Miller" <davem@redhat.com>
In newsgroup: linux.dev.kernel
>
> How about first finding out why their buggy JRE detects whether an
> address is local by trying to bind() to it :-)
>
> Really, when an application feeds a specific address into bind() it
> must have good reason for selecting it. All I want to know in this
> specific instance, is why Sun's JRE is sending non-local addresses
> into bind(), that's all.
>

autofs uses the following algorithm to determine if an address is
local: connect to it as the remote end using a datagram socket (so
there isn't any actual network traffic). If the LOCAL address (which
is picked by the system) and the REMOTE address (the address under
test) are identical afterwards, the address is local.

        -hpa

-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt
-
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