Re: git: 20d59403961d - main - kernel: deprecate Internet Class A/B/C

From: Mike Karels <>
Date: Wed, 10 Nov 2021 15:36:03 UTC
Gleb Smirnoff wrote:

>  Mike,

> On Tue, Nov 09, 2021 at 03:36:01PM +0000, Mike Karels wrote:
> M> commit 20d59403961d531467cfab22163f49c131cc8b55
> M> Author:     Mike Karels <>
> M> AuthorDate: 2021-10-27 03:01:09 +0000
> M> Commit:     Mike Karels <>
> M> CommitDate: 2021-11-09 15:32:38 +0000
> M> 
> M>     kernel: deprecate Internet Class A/B/C
> M>     
> M>     Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined;
> M>     define it for user level.  Define IN_MULTICAST separately from IN_CLASSD,
> M>     and use it in pf instead of IN_CLASSD.  Stop using class for setting
> M>     default masks when not specified; instead, define new default mask
> M>     (24 bits).  Warn when an Internet address is set without a mask.
> M>     
> M>     MFC after:      1 month
> M>     Reviewed by:    cy
> M>     Differential Revision:

> Just my 2 cents. I wasn't added as reviewer of D32708 and that's
> why totally missed it. IMHO, such reviews should have #network as
> reviewer.

I wasn't aware of #network, or I would have added it.  I publicized
the reviews on freebsd-net, and asked people to add themselves.  There
was also discussion of some parts of this, including default mask.

> I'm convinced that the status of classful addressing that was left
> exactly 10 years go in b365d954cc9c39e9854eeb726a60ae812e0fb2fe was
> good enough.  After that change the only place where classes exist
> is the mask autoguessing. It was absolutely backward compatible and
> not breaking any POLA. And had zero code maintainance burden! Nobody
> have ever had problems with classes since. Did existence of the small
> piece of code in in_aifaddr_ioctl() or class definitions in in.h
> created any conflicts with development of any new code?

I'm not aware of conflicts, but we are even farther from classful
addressing than 10 years ago.  There were still a *lot* of references
in the base system, and I'm working to reduce them.  Some of them are in
obsolete code that isn't worth updating, some (like the *stat programs)
are in mainline code.

> The new /24 default is no better than classes. The only difference
> that classes maintained POLA and new default doesn't. For example,
> in my home network I have default router and since it is
> class A network on my VMs and test boxes I can type

> # ifconfig vtnet0

> and that is going to work. With this change no longer.

I suspect that /8 is by far the minority these days, even with a
"Class A" net.  I also use net 10 at home, and at the last several jobs,
but it is subnetted in each case.  I would peridically add an address,
forgetting a mask, only to find that a route for 10/8 isolated the machine.

That said, my main objective was to deprecate usage without a mask, and
to warn in that case.  Both the kernel and ifconfig now warn when a default
mask is used.  In the discussion on freebsd-net and in the review, the
main thought was that masks should be required.  But it isn't practical to
fail and return an error with no mask, at least not without a significant
period with warnings, or some systems would stop coming up on the network.

One reviewer was going to comment on the /24 default, but thought it was
better than the previous.  I'm open to hearing more opinions.