Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread Peter Wemm

"David O'Brien" wrote:
> On Sun, Mar 25, 2001 at 04:08:47PM +0300, Valentin Nechayev wrote:
> > 192.168.5 should be interpreted as 192.168.0.5 in host address context,
> > but as 192.168.5.0 in network address context. (Such network address
> > context is well seen in sentences such as "10/8", "192.168/16".)
> 
> Where is this documented?

peter@daintree[10:39am]/tmp-162> cat foo.c
main()
{
int x;

x = inet_network("127.1");
printf("inet_network(127.1) = %x\n", x);
x = inet_addr("127.1");
printf("inet_addr(127.1) = %x\n", htonl(x));
}
peter@daintree[10:39am]/tmp-163> cc -o foo foo.c
peter@daintree[10:40am]/tmp-164> ./foo
inet_network(127.1) = 7f01
inet_addr(127.1) = 7f01

inet_addr() and family returns network order, while inet_network() returns
host order.

The old mountd code went to a lot of trouble to keep the two seperate.
In host context, it would have interpreted it as 192.168.0.5, but in network
/ netmask context it intentionally interpreted it as 192.168.5.0/mask.
See the old get_host() vs get_net() code.

Now that I have looked more closely, IMHO the new code is broken. :-(

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread David O'Brien

On Sun, Mar 25, 2001 at 04:08:47PM +0300, Valentin Nechayev wrote:
> 192.168.5 should be interpreted as 192.168.0.5 in host address context,
> but as 192.168.5.0 in network address context. (Such network address
> context is well seen in sentences such as "10/8", "192.168/16".)

Where is this documented?
 
-- 
-- David  ([EMAIL PROTECTED])
  GNU is Not Unix / Linux Is Not UniX

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread David W. Chapman Jr.

> 192.168.5 should be interpreted as 192.168.0.5 in host address context,
> but as 192.168.5.0 in network address context. (Such network address
> context is well seen in sentences such as "10/8", "192.168/16".)
The only problem I see with 10/8 is that when broken down into binary they
do not match

10.0.0.0/8

1010


and just 10

1010


the significance of one "octet" is that the above(10.0.0.0) can be written
in this form as 167772160 which doesn't equal 10


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread Leif Neland

Bikeshed time ! :-)

- Original Message - 
From: "Valentin Nechayev" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, March 25, 2001 3:08 PM
Subject: Re: /etc/exports: 192.168.5 = 192.168.0.5


> > > /var -alldirs -maproot=root: -network 192.168.5 -mask 255.255.255.0
> > > showmount -e showed 192.168.5 was being interpreted as 192.168.0.5
> > This is the correct interpretation.
> > > Changing -network to 192.168.5.0 fixed it, naturally, but the 192.168.5
> > > used to work.
> > It was broken, then. :-)
> 
> 192.168.5 should be interpreted as 192.168.0.5 in host address context,
> but as 192.168.5.0 in network address context. (Such network address
> context is well seen in sentences such as "10/8", "192.168/16".)
> 
> netch@iv:~/tmp>netstat -rn | grep 192
> 192/8  127.0.0.1  UGSc00  lo0
> 
> In case in question, when -network prefix is occured, parsing should
> be performed with network address context, not host address context.
> 
> 
> /netch
> 
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-current" in the body of the message
> 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread David W. Chapman Jr.

Its always been working in the correct way for stable and currently is right
now.

- Original Message -
From: "Daniel C. Sobral" <[EMAIL PROTECTED]>
To: "Leif Neland" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, March 25, 2001 6:52 AM
Subject: Re: /etc/exports: 192.168.5 = 192.168.0.5


> Leif Neland wrote:
> >
> > > > showmount -e showed 192.168.5 was being interpreted as 192.168.0.5
> > >
> > > This is the correct interpretation.
> > >
> > > >
> > > > Changing -network to 192.168.5.0 fixed it, naturally, but the
192.168.5
> > > > used to work.
> > >
> > > It was broken, then. :-)
> > >
> > So an unlisted bug was fixed :-)
>
> Quick! Open a PR about -stable! :-)
>
> --
> Daniel C. Sobral (8-DCS)
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>
> all your kernels arpanic: blockable sleep lock (sleep mutex) Giant @
> ../../kern/kern_sig.c:153
>
> To Unsubscribe: send mail to [EMAIL PROTECTED]
> with "unsubscribe freebsd-current" in the body of the message
>


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread Valentin Nechayev

> > /var -alldirs -maproot=root: -network 192.168.5 -mask 255.255.255.0
> > showmount -e showed 192.168.5 was being interpreted as 192.168.0.5
> This is the correct interpretation.
> > Changing -network to 192.168.5.0 fixed it, naturally, but the 192.168.5
> > used to work.
> It was broken, then. :-)

192.168.5 should be interpreted as 192.168.0.5 in host address context,
but as 192.168.5.0 in network address context. (Such network address
context is well seen in sentences such as "10/8", "192.168/16".)

netch@iv:~/tmp>netstat -rn | grep 192
192/8  127.0.0.1  UGSc00  lo0

In case in question, when -network prefix is occured, parsing should
be performed with network address context, not host address context.


/netch

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread Daniel C. Sobral

Leif Neland wrote:
> 
> > > showmount -e showed 192.168.5 was being interpreted as 192.168.0.5
> >
> > This is the correct interpretation.
> >
> > >
> > > Changing -network to 192.168.5.0 fixed it, naturally, but the 192.168.5
> > > used to work.
> >
> > It was broken, then. :-)
> >
> So an unlisted bug was fixed :-)

Quick! Open a PR about -stable! :-)

-- 
Daniel C. Sobral(8-DCS)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

all your kernels arpanic: blockable sleep lock (sleep mutex) Giant @
../../kern/kern_sig.c:153

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread Leif Neland


> > showmount -e showed 192.168.5 was being interpreted as 192.168.0.5
>
> This is the correct interpretation.
>
> >
> > Changing -network to 192.168.5.0 fixed it, naturally, but the 192.168.5
> > used to work.
>
> It was broken, then. :-)
>
So an unlisted bug was fixed :-)

Leif



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread Jeroen Ruigrok/Asmodai

-On [20010325 09:45], Leif Neland ([EMAIL PROTECTED]) wrote:
>/var -alldirs -maproot=root: -network 192.168.5 -mask 255.255.255.0
>
>But after the portmapper change, I couldn't mount, was getting permission
>denied.
>
>showmount -e showed 192.168.5 was being interpreted as 192.168.0.5
>
>Changing -network to 192.168.5.0 fixed it, naturally, but the 192.168.5
>used to work.

You can only `compress' leading zeroes IIRC.  So it should have had
interpreted the .5 as 000.005, not 005.000.

-- 
Jeroen Ruigrok van der Werven/Asmodai .oUo. asmodai@[wxs.nl|freebsd.org]
Documentation nutter/C-rated Coder BSD: Technical excellence at its best  
  D78D D0AD 244D 1D12 C9CA  7152 035C 1138 546A B867
Time will tell everything - given time...

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread David W. Chapman Jr.

>From a pure logic point of view here's something that might help you
understand it

the 4 octets are broken down into binary and then combined without the
decimal point.

when whatever libraries are doing this, the first octec(192) is converted to
binary.  Then there is probably some sort of if statement that says if there
is only one more octet to process make it the last octet.  The reason for
this is so you can enter in ip addresses like 3232236800 which is another
way of looking at 192.168.5.0, if it wasn't processed like this, it might
try to ping 3232236800.0.0.0

If I've caused any more confusion than help, let me know and I can email you
in private and help better explain.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-25 Thread Daniel C. Sobral

Leif Neland wrote:
> 
> Bug or pilot error?
> 
> My network is 192.168.5.0
> 
> I used to have im my /etc/exports:
> 
> /var -alldirs -maproot=root: -network 192.168.5 -mask 255.255.255.0
> 
> But after the portmapper change, I couldn't mount, was getting permission
> denied.
> 
> showmount -e showed 192.168.5 was being interpreted as 192.168.0.5

This is the correct interpretation.

> 
> Changing -network to 192.168.5.0 fixed it, naturally, but the 192.168.5
> used to work.

It was broken, then. :-)

-- 
Daniel C. Sobral(8-DCS)
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

all your kernels arpanic: blockable sleep lock (sleep mutex) Giant @
../../kern/kern_sig.c:153

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: /etc/exports: 192.168.5 = 192.168.0.5

2001-03-24 Thread Peter Wemm

Leif Neland wrote:
> Bug or pilot error?
> 
> My network is 192.168.5.0
> 
> I used to have im my /etc/exports:
> 
> /var -alldirs -maproot=root: -network 192.168.5 -mask 255.255.255.0
> 
> But after the portmapper change, I couldn't mount, was getting permission
> denied.
> 
> showmount -e showed 192.168.5 was being interpreted as 192.168.0.5
> 
> Changing -network to 192.168.5.0 fixed it, naturally, but the 192.168.5
> used to work.
> 
> Is this change intentional, or is 192.168.5 supposed to work?
> 
> Leif

My buest guess is that this is because it is now using something like 
inet_addr() for decoding the address instead of some roll-your-own code.
FWIW, this zero fill is a standard part of the system:

peter@daintree[11:24pm]~src/sys/pci-142> ping 192.168.5
PING 192.168.5 (192.168.0.5): 56 data bytes
..
peter@daintree[12:13am]~src/sys/pci-143> ping 127.1
PING 127.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.068 ms
..

This is far more prolific in IPv6.  Eg: "ping ::1" is localhost.

Cheers,
-Peter
--
Peter Wemm - [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
"All of this is for nothing if we don't go to the stars" - JMS/B5


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message