From owner-freebsd-bugs Thu Jun 27 17:12:57 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 995DA37B420 for ; Thu, 27 Jun 2002 17:12:18 -0700 (PDT) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g5S0A6JU061022 for ; Thu, 27 Jun 2002 17:10:06 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g5S0A5G1061018; Thu, 27 Jun 2002 17:10:05 -0700 (PDT) Date: Thu, 27 Jun 2002 17:10:05 -0700 (PDT) Message-Id: <200206280010.g5S0A5G1061018@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Jin Guojun[DSD]" Subject: Re: bin/39896: netmask 0xffffff00 no longer works in /etc/exports Reply-To: "Jin Guojun[DSD]" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/39896; it has been noted by GNATS. From: "Jin Guojun[DSD]" To: Ian Dowse Cc: "Crist J. Clark" , FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/39896: netmask 0xffffff00 no longer works in /etc/exports Date: Thu, 27 Jun 2002 17:03:08 -0700 Ian Dowse wrote: > > In message <200206271910.g5RJA4sI004556@freefall.freebsd.org>, "Crist J. Clark" > writes: > > Your error is here, > > > > > eubie# echo "/data -network 131.243.2 -mask 255.255.255.0" > /etc/exports > > ^ > > As I understand inet_network(3), you are refering to the network, > > > > 131.243.0.2 > > I'm not super-familiour with the intricacies of parsing <4 part IP > addresses, but if you look at the code or instrument mountd, you > will see that this is not the case for inet_network() (I think the > effect you refer to happens to IP addresses, not network numbers). > > Below is a simple patch for inet_network() that makes it support > 32-bit hex network numbers. It now also returns INADDR_NONE in a > few cases where previously the number would be silently truncated. > This could probably be improved upon. > > Ian > > Index: inet_network.c > =================================================================== > RCS file: /home/iedowse/CVS/src/lib/libc/net/inet_network.c,v > retrieving revision 1.6.2.1 > diff -u -r1.6.2.1 inet_network.c > --- inet_network.c 21 Apr 2001 14:53:04 -0000 1.6.2.1 > +++ inet_network.c 27 Jun 2002 19:55:06 -0000 > @@ -85,6 +85,8 @@ > return (INADDR_NONE); > *pp++ = val; > n = pp - parts; > + if (val > 0xff) > + return (n == 1 ? val : INADDR_NONE); > for (val = 0, i = 0; i < n; i++) { > val <<= 8; > val |= parts[i] & 0xff; Yup, it fixed the problem. I have looked and diffed mountd and related sources, but did not find any significant change. most files are not changed. inet_network.c is the same in both 4.5 and 4.6. How it works under 4.5 but not under 4.6 is a mystery. I will try to trace what happend in 4.6 a little further. If some developer feels something they changed may have affection to this, pleae send message to this liet, so we can benefit from it. To understand what causes the problem is more important than a fix. Thanks folks, -- ------------ Jin Guojun ----------- v --- j_guojun@lbl.gov --- Distributed Systems Department http://www.itg.lbl.gov/~jin M/S 50B-2239 Ph#:(510) 486-7531 Fax: 486-6363 Lawrence Berkeley National Laboratory, Berkeley, CA 94720 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message