svn commit: r190758 - head/sbin/route

Randall Stewart rrs at lakerest.net
Mon Apr 6 06:35:06 PDT 2009


Hmm.

On Apr 6, 2009, at 6:39 AM, Alexander Motin wrote:

> Randall Stewart wrote:
>> Author: rrs
>> Date: Mon Apr  6 10:09:20 2009
>> New Revision: 190758
>> URL: http://svn.freebsd.org/changeset/base/190758
>>
>> Log:
>>  Class based addressing went out in the early 90's. Basically
>>  if a entry is not route add -net xxx/bits then we should use
>>  the addr (xxx) to establish the number of bits by looking at
>>  the first non-zero bit. So if we enter
>>  route add -net 10.1.1.0 10.1.3.5
>>  this is the same as doing
>>  route add -net 10.1.1.0/24
>>  Since the 8th bit (zero counting) is set to 1 we set bits
>>  to 32-8.
>>
>>  Users can of course still use the /x to change this behavior
>>  or in cases where the network is in the trailing part
>>  of the address, a "netmask" argument can be supplied to
>>  override what is established from the interpretation of the
>>  address itself. e.g:
>>
>>  route add -net 10.1.1.8 -netmask 0xff00ffff
>>
>>  should overide and place the proper CIDR mask in place.
>>
>>  PR:		131365
>>  MFC after:	1 week
>
> Are you sure that this is a good idea? Is this behavior
> described/recommended somewhere? IMHO specifying network without
> explicitly defined netmask is at least dangerous, if not wrong, in
> present classless addressing time. Changing existing behavior breaks
> POLA for some set of users, while benefits are not so obvious to me.
> With previous code networks 10.0.0.0 and 11.0.0.0 were treated as /8,
> but with this change it became /7 and /8 respectively.


Well it is how CIDR works.. and cidr's been around since before
1997. I can go dig up the RFC's that specifu this if you woudl like

>
>
> Author of the PR referred here expects network 192.168 to be treated  
> as
> /16, but with your algorithm it will probably become /13.

Drat... your right.. hmm.

I need to go back and see how the old 6.0 stuff used to work properly..

R
>
>
> -- 
> Alexander Motin
>

------------------------------
Randall Stewart
803-317-4952 (cell)
803-345-0391(direct)



More information about the svn-src-head mailing list