From owner-freebsd-bugs Thu Jun 27 11:40:14 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 EC56937B405 for ; Thu, 27 Jun 2002 11:40:03 -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 g5RIe3JU096793 for ; Thu, 27 Jun 2002 11:40:03 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g5RIe3Mg096791; Thu, 27 Jun 2002 11:40:03 -0700 (PDT) Date: Thu, 27 Jun 2002 11:40:03 -0700 (PDT) Message-Id: <200206271840.g5RIe3Mg096791@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Ian Dowse Subject: Re: bin/39896: netmask 0xffffff00 no longer works in /etc/exports Reply-To: Ian Dowse 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: Ian Dowse To: cjclark@alum.mit.edu Cc: FreeBSD-gnats-submit@FreeBSD.ORG, "Jin Guojun[DSD]" Subject: Re: bin/39896: netmask 0xffffff00 no longer works in /etc/exports Date: Thu, 27 Jun 2002 19:30:48 +0100 In message <20020627111801.B77359@blossom.cjclark.org>, "Crist J. Clark" writes : >On Thu, Jun 27, 2002 at 06:59:01PM +0100, Ian Dowse wrote: >> I'm not sure how this could have ever worked correctly, since >> inet_network(3) does not support hex addresses of this form. > >Actually, it does. The manpage says, > > All numbers supplied as ``parts'' in a `.' notation may be decimal, > octal, or hexadecimal, as specified in the C language (i.e., a leading 0x > or 0X implies hexadecimal; otherwise, a leading 0 implies octal; other- > wise, the number is interpreted as decimal). > >And since it is perfectly valid to provide an internet address as a >single "part," an address like 0xffffff00 is totally valid by these >rules. To illustrate this, all of these are the same IP address, Ok, but the code in inet_network() seems to disagree ... for (val = 0, i = 0; i < n; i++) { val <<= 8; val |= parts[i] & 0xff; } return (val); so 0xffffff00 gets converted to 0. Ian To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message