Page MenuHomeFreeBSD

ifconfig: turn interface address without mask into an error
ClosedPublic

Authored by emaste on Jun 13 2024, 5:43 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 14, 10:26 PM
Unknown Object (File)
Jun 16 2024, 4:41 AM
Unknown Object (File)
Jun 15 2024, 6:33 PM
Unknown Object (File)
Jun 13 2024, 9:42 PM

Details

Summary
In commit d8237b955528 as part of the deprecation of IPv4 address
classes Mike Karels introduced a warning in ifconfig for setting an
address without a width or mask.  The commit message says "This will
hopefully be an error in the future."

As the warning has been included in releases from FreeBSD 13.1 on, and
sufficient time has passed, turn this into an error.

Open question: when do we commit this? Now, in advance of 15.0? As soon as stable/15 branches, so that it will first arrive in 16.0?

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste created this revision.

(This change was prompted by the freebsd-current discussion that led to D45570.)

Open question: when do we commit this? Now, in advance of 15.0? As soon as stable/15 branches, so that it will first arrive in 16.0?

I'd argue we should do it now (i.e. so that it'll be part of 15.0).
The warning has been present since 13.1, so that's two full major releases of warning (on top of the fact that not specifying a mask has been a bad idea since about 1993). That seems plenty long enough.
And if we're going to do it for 15 we should include this change sooner rather than later, so that there's more time for people to notice any fallout before the release.

In D45585#1040016, @kp wrote:

Open question: when do we commit this? Now, in advance of 15.0? As soon as stable/15 branches, so that it will first arrive in 16.0?

I'd argue we should do it now (i.e. so that it'll be part of 15.0).
The warning has been present since 13.1, so that's two full major releases of warning (on top of the fact that not specifying a mask has been a bad idea since about 1993). That seems plenty long enough.
And if we're going to do it for 15 we should include this change sooner rather than later, so that there's more time for people to notice any fallout before the release.

+1 for we should do it now .

allanjude added a subscriber: allanjude.

The warning has been there long enough, and an error is better than doing the wrong thing, it has far fewer side effects.

I suggest we do make it very prominent in the release notes though, as I anticipate someone is going to reboot a machine and find it not on the network anymore.

This revision is now accepted and ready to land.Jun 14 2024, 2:02 PM

Yes, please (for 15).

sbin/ifconfig/af_inet.c
438–439
442
454
457–458
sbin/ifconfig/af_inet.c
458

Apparently, Phab didn't accept two overlapping suggested edits.

@olce I mentioned on the mailing list thread that I made it a minimal change to avoid interfering with future MFCs and planned to add the changes you proposed after the previous versions go EOL. But perhaps that's excessively conservative.

No need to be so conservative wrt potential future MFCs

This revision now requires review to proceed.Jun 14 2024, 2:38 PM

I mentioned on the mailing list thread that I made it a minimal change to avoid interfering with future MFCs and planned to add the changes you proposed after the previous versions go EOL. But perhaps that's excessively conservative.

Oh, wasn't aware.

This revision is now accepted and ready to land.Jun 14 2024, 2:51 PM
gordon added a subscriber: gordon.

Seeing how CIDR has been a thing for around 30 years, erroring without a netmask is the appropriate action here.

Add UPDATING entry, will commit shortly.

This revision now requires review to proceed.Jun 17 2024, 3:52 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jun 18 2024, 12:21 AM
This revision was automatically updated to reflect the committed changes.