Page MenuHomeFreeBSD

ifconfig: reject netmask and broadcast for inet6
ClosedPublic

Authored by ivy on May 19 2025, 4:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 27, 7:30 AM
Unknown Object (File)
Wed, Nov 26, 1:40 PM
Unknown Object (File)
Mon, Nov 24, 8:33 PM
Unknown Object (File)
Fri, Nov 21, 8:59 PM
Unknown Object (File)
Nov 7 2025, 9:55 PM
Unknown Object (File)
Oct 29 2025, 2:39 AM
Unknown Object (File)
Oct 20 2025, 12:59 AM
Unknown Object (File)
Oct 15 2025, 6:17 AM
Subscribers

Details

Summary

we don't support setting netmask or broadcast address for INET6
addresses, and trying to do crashes ifconfig. handle this the
same way as af_link, by rejecting attempts to configure these
parameters.

PR: 286910
Reported by: Hayzam Sherif <hayzam@alchemilla.io>
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 64284
Build 61168: arc lint + arc unit

Event Timeline

ivy requested review of this revision.May 19 2025, 4:14 AM
sbin/ifconfig/tests/Makefile
1

I know this looks weird but it's a genuine test script for ifconfig from NetBSD, please don't remove it.

keep the oddly-named netbsd test

This revision is now accepted and ready to land.May 19 2025, 5:03 AM
ivy marked an inline comment as done.May 19 2025, 5:28 AM
zlei added a subscriber: zlei.

Generally looks good to me.

sbin/ifconfig/af_inet6.c
432

IPv6 does not have terminology such as netmask or broadcast. I'm not a native speaker, but that IPv6 netmask / broadcast sounds confusing to me.

sbin/ifconfig/tests/inet6.sh
38

IPv6 does not have terminology such as netmask or broadcast

Do not forget to update the test case as well.

sbin/ifconfig/af_inet6.c
432

would you be happier with something like "can't set netmask or broadcast for inet6"?

sbin/ifconfig/af_inet6.c
432

would you be happier with something like "can't set netmask or broadcast for inet6"?

Or it is better to show the reason, say "Invalid option netmask / broadcast" ?

update the error message

This revision now requires review to proceed.May 20 2025, 6:01 PM
This revision is now accepted and ready to land.May 21 2025, 3:31 AM
This revision was automatically updated to reflect the committed changes.