From owner-freebsd-current Sun Mar 25 10:47:14 2001 Delivered-To: freebsd-current@freebsd.org Received: from peter3.wemm.org (c1315225-a.plstn1.sfba.home.com [65.0.135.147]) by hub.freebsd.org (Postfix) with ESMTP id 7C41837B719; Sun, 25 Mar 2001 10:47:11 -0800 (PST) (envelope-from peter@netplex.com.au) Received: from mobile.wemm.org (mobile.wemm.org [10.0.0.5]) by peter3.wemm.org (8.11.0/8.11.0) with ESMTP id f2PIlBp15550; Sun, 25 Mar 2001 10:47:11 -0800 (PST) (envelope-from peter@netplex.com.au) Received: from netplex.com.au (localhost [127.0.0.1]) by mobile.wemm.org (8.11.1/8.11.1) with ESMTP id f2PIl9h13551; Sun, 25 Mar 2001 10:47:09 -0800 (PST) (envelope-from peter@netplex.com.au) Message-Id: <200103251847.f2PIl9h13551@mobile.wemm.org> X-Mailer: exmh version 2.2 06/23/2000 with nmh-1.0.4 To: obrien@FreeBSD.ORG Cc: Valentin Nechayev , freebsd-current@FreeBSD.ORG, mb@imp.ch, alfred@FreeBSD.ORG Subject: Re: /etc/exports: 192.168.5 = 192.168.0.5 In-Reply-To: <20010325101710.C58992@dragon.nuxi.com> Date: Sun, 25 Mar 2001 10:47:09 -0800 From: Peter Wemm Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG "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