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, Oct 19, 8:59 AM
Unknown Object (File)
Oct 7 2024, 2:41 PM
Unknown Object (File)
Oct 1 2024, 1:22 PM
Unknown Object (File)
Oct 1 2024, 5:46 AM
Unknown Object (File)
Sep 24 2024, 11:23 AM
Unknown Object (File)
Sep 24 2024, 12:12 AM
Unknown Object (File)
Sep 23 2024, 2:30 AM
Unknown Object (File)
Sep 23 2024, 2:30 AM
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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.