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, Sep 1, 8:31 AM
Unknown Object (File)
Thu, Aug 28, 8:03 AM
Unknown Object (File)
Wed, Aug 20, 2:30 PM
Unknown Object (File)
Mon, Aug 18, 10:45 PM
Unknown Object (File)
Fri, Aug 15, 10:01 AM
Unknown Object (File)
Thu, Aug 14, 11:21 PM
Unknown Object (File)
Aug 1 2025, 5:44 PM
Unknown Object (File)
Jul 26 2025, 8:33 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 65847
Build 62730: arc lint + arc unit

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