Page MenuHomeFreeBSD

ifconfig: reject netmask and broadcast for inet6
ClosedPublic

Authored by ivy on Mon, May 19, 4:14 AM.
Tags
None
Referenced Files
F118763960: D50413.id155807.diff
Sun, Jun 1, 4:41 PM
Unknown Object (File)
Sun, Jun 1, 2:59 AM
Unknown Object (File)
Wed, May 28, 11:32 AM
Unknown Object (File)
Wed, May 28, 11:17 AM
Unknown Object (File)
Tue, May 27, 12:23 PM
Unknown Object (File)
Sat, May 24, 7:04 AM
Unknown Object (File)
Wed, May 21, 6:19 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy requested review of this revision.Mon, May 19, 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.Mon, May 19, 5:03 AM
ivy marked an inline comment as done.Mon, May 19, 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
39

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.Tue, May 20, 6:01 PM
This revision is now accepted and ready to land.Wed, May 21, 3:31 AM
This revision was automatically updated to reflect the committed changes.