Page MenuHomeFreeBSD

kernel: deprecate Internet Class A/B/C
ClosedPublic

Authored by karels on Oct 28 2021, 2:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 17, 11:32 PM
Unknown Object (File)
Thu, Feb 8, 9:22 PM
Unknown Object (File)
Thu, Feb 8, 5:11 AM
Unknown Object (File)
Dec 20 2023, 6:47 AM
Unknown Object (File)
Dec 9 2023, 3:21 PM
Unknown Object (File)
Dec 8 2023, 9:20 PM
Unknown Object (File)
Dec 1 2023, 12:53 PM
Unknown Object (File)
Nov 28 2023, 10:14 PM
Subscribers

Details

Summary

Hide historical Class A/B/C macros unless IN_HISTORICAL_NETS is defined;
define it for user level. Define IN_MULTICAST separately from IN_CLASSD,
and use it in pf instead of IN_CLASSD. Stop using class for setting
default masks when not specified; instead, define new default mask
(24 bits). Warn when an Internet address is set without a mask.

Test Plan

tested with full build

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42588
Build 39476: arc lint + arc unit

Event Timeline

sys/nfs/bootp_subr.c
657

Why is 0xff000000 right here? I know it is historical behavior, but what is its root? Does it deserve a comment?

sys/nfs/bootp_subr.c
657

I don't know why this value is used. It may deserve a comment, but I wouldn't know what to say.

Other than answering Warner's question (documenting 0xff000000), LGTM.

This revision is now accepted and ready to land.Oct 30 2021, 3:00 AM

Otherwise LTGM too from scrolling through.

sys/netinet/in.c
462

I was going to argue that a /24 doesn't make much sense anymore these days in most places and if one doesn't give a netmask it should probably be a /32 used here but then I saw the old "else" case above and though "okay".

One 2nd though has anyone tested

ifconfig lo0 inet 127.0.2.2 gets the correct mask? Is that handled somewhere?

sys/netinet/in.c
462

Agreed that /24 often isn't right, but /8 and /16 are less likely to be right. I'd love to make it an error not to specify a mask, but that would make some systems fail to come up suddenly.

About lo0: the command listed would default to a /24, although the standard 127.0.0.1 is set by the network scripts to /8. Does it matter what the mask is on loopback? The only route is to our own address.

This revision now requires review to proceed.Nov 4 2021, 7:23 PM
This revision is now accepted and ready to land.Nov 5 2021, 4:57 PM
This revision was automatically updated to reflect the committed changes.