Skip to content

[vlan] bound VLAN IDs to 1..=4094 per IEEE 802.1Q - #356

Merged
zeeshanlakhani merged 1 commit into
mainfrom
zl/vlan-range-fix
Aug 31, 2026
Merged

[vlan] bound VLAN IDs to 1..=4094 per IEEE 802.1Q#356
zeeshanlakhani merged 1 commit into
mainfrom
zl/vlan-range-fix

Conversation

@zeeshanlakhani

@zeeshanlakhani zeeshanlakhani commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Now, we validate a VLAN ID against the configurable range 1..=4094.

Per IEEE 802.1Q §9.6, VID 0 is the null VID used for priority tagging and carries no VLAN membership, and VID 4095 is reserved for implementation use and must not be configured. VID 1 is the default port VID.

Also route uplinkd's uplink-address and interface-name parsers through the same validation fn to match the API path.

Note: I'm working on a bigger oxnet PR where we'll have a VlanId newtype to share this across repositories. I've punted on a newtype for the moment (oxnet PR incoming in a day or two). This tries to make things consistent across the board.

@zeeshanlakhani

Copy link
Copy Markdown
Contributor Author

As @taspelund, he's started on oxidecomputer/oxnet#85 and I'm working on a oxnet PR off his work there. This is a stop-gap until the oxnet work lands is updated throughout our ecosystem.

Now, we validate a `VLAN ID` against the configurable range `1..=4094`.

Per [IEEE 802.1Q §9.6](https://ieeexplore.ieee.org/document/10004498),
VID 0 is the null VID used for priority tagging and carries no VLAN
membership, and VID 4095 is reserved for implementation use and must not
be configured. VID 1 is the default port VID.

Also route uplinkd's uplink-address and interface-name parsers through
the same validation fn to match the API path.

@taspelund taspelund left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. I'm excited to replace this with an oxnet type, but I know it's coming :-)

@zeeshanlakhani

Copy link
Copy Markdown
Contributor Author

Changes look good. I'm excited to replace this with an oxnet type, but I know it's coming :-)

for sure. I hope to have a full oxnet (based on your branch) piece up for tmrw.

@zeeshanlakhani
zeeshanlakhani merged commit 0fceb6b into main Aug 31, 2026
6 checks passed
@zeeshanlakhani
zeeshanlakhani deleted the zl/vlan-range-fix branch August 31, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants