Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 2002 13:20:04 -0700 (PDT)
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/39896: netmask 0xffffff00 no longer works in /etc/exports 
Message-ID:  <200206272020.g5RKK4k0016627@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: Ian Dowse <iedowse@maths.tcd.ie>
To: "Crist J. Clark" <crist.clark@attbi.com>
Cc: "Jin Guojun[DSD]" <j_guojun@lbl.gov>,
	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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206272020.g5RKK4k0016627>