From owner-freebsd-bugs Thu Jun 27 13:20:48 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 9D64D37B405 for ; Thu, 27 Jun 2002 13:20:27 -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 g5RKK5JU016634 for ; Thu, 27 Jun 2002 13:20:07 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g5RKK4k0016627; Thu, 27 Jun 2002 13:20:04 -0700 (PDT) Date: Thu, 27 Jun 2002 13:20:04 -0700 (PDT) Message-Id: <200206272020.g5RKK4k0016627@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: "Crist J. Clark" Cc: "Jin Guojun[DSD]" , FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/39896: netmask 0xffffff00 no longer works in /etc/exports Date: Thu, 27 Jun 2002 21:10:13 +0100 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; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message