Date: Sun, 25 Mar 2001 10:47:09 -0800 From: Peter Wemm <peter@netplex.com.au> To: obrien@FreeBSD.ORG Cc: Valentin Nechayev <netch@iv.nn.kiev.ua>, freebsd-current@FreeBSD.ORG, mb@imp.ch, alfred@FreeBSD.ORG Subject: Re: /etc/exports: 192.168.5 = 192.168.0.5 Message-ID: <200103251847.f2PIl9h13551@mobile.wemm.org> In-Reply-To: <20010325101710.C58992@dragon.nuxi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
"David O'Brien" wrote: > On Sun, Mar 25, 2001 at 04:08:47PM +0300, Valentin Nechayev wrote: > > 192.168.5 should be interpreted as 192.168.0.5 in host address context, > > but as 192.168.5.0 in network address context. (Such network address > > context is well seen in sentences such as "10/8", "192.168/16".) > > Where is this documented? peter@daintree[10:39am]/tmp-162> cat foo.c main() { int x; x = inet_network("127.1"); printf("inet_network(127.1) = %x\n", x); x = inet_addr("127.1"); printf("inet_addr(127.1) = %x\n", htonl(x)); } peter@daintree[10:39am]/tmp-163> cc -o foo foo.c peter@daintree[10:40am]/tmp-164> ./foo inet_network(127.1) = 7f01 inet_addr(127.1) = 7f000001 inet_addr() and family returns network order, while inet_network() returns host order. The old mountd code went to a lot of trouble to keep the two seperate. In host context, it would have interpreted it as 192.168.0.5, but in network / netmask context it intentionally interpreted it as 192.168.5.0/mask. See the old get_host() vs get_net() code. Now that I have looked more closely, IMHO the new code is broken. :-( Cheers, -Peter -- Peter Wemm - peter@FreeBSD.org; peter@yahoo-inc.com; peter@netplex.com.au "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103251847.f2PIl9h13551>