Page MenuHomeFreeBSD

ifconfig: Support VLAN ID in static/deladdr
ClosedPublic

Authored by ivy on Jul 11 2025, 6:06 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 13, 7:12 PM
Unknown Object (File)
Mon, Oct 13, 7:11 PM
Unknown Object (File)
Mon, Oct 13, 7:11 PM
Unknown Object (File)
Mon, Oct 13, 7:11 PM
Unknown Object (File)
Mon, Oct 13, 5:52 AM
Unknown Object (File)
Thu, Oct 2, 4:00 PM
Unknown Object (File)
Thu, Sep 18, 12:32 AM
Unknown Object (File)
Sep 15 2025, 11:40 AM

Details

Summary
Add a new type of ifconfig command, DEF_CMD_VARG, which supports a
variable number of arguments.

Use this to add an optional 'vlan <n>' argument to static and deladdr,
which specify the bridge VLAN ID that the address should be added to
or removed from.

Add tests for the new functionality, and improve the test for the
existing "static" command.

Diff Detail

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

Event Timeline

ivy requested review of this revision.Jul 11 2025, 6:06 AM
ivy retitled this revision from bridge: add ifconfig(8) vstatic/vdeladdr commands to ifconfig: Support VLAN ID in static/deladdr.Jul 30 2025, 2:38 PM
ivy edited the summary of this revision. (Show Details)
ivy added a subscriber: fuz.

rebase on main and remove from the stack

change the syntax as suggested by @fuz:

% ifconfig bridge0 static <intf> <addr> [vlan <id>]
% ifconfig bridge0 deladdr <addr> [vlan <id>]

this avoids the need to add a new command.

LGTM, but please split this into two: one to add the ARGVECTOR / c_funcv notion, and one to adopt it for static/deladdr. My reasoning here (in general) is that while the latter isn't useful without the former, later changes (however unlikely) could adopt it that might make it useful to MFC in a different timeframe (if even planned) than you're planning for vlan features. It's also a useful addition to highlight independently of your specific use-case here.

This revision is now accepted and ready to land.Jul 31 2025, 2:41 PM