Date: Thu, 27 Jun 2002 17:10:05 -0700 (PDT) From: "Jin Guojun[DSD]" <j_guojun@lbl.gov> To: freebsd-bugs@FreeBSD.org Subject: Re: bin/39896: netmask 0xffffff00 no longer works in /etc/exports Message-ID: <200206280010.g5S0A5G1061018@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/39896; it has been noted by GNATS. From: "Jin Guojun[DSD]" <j_guojun@lbl.gov> To: Ian Dowse <iedowse@maths.tcd.ie> Cc: "Crist J. Clark" <crist.clark@attbi.com>, 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206280010.g5S0A5G1061018>