[vlan] bound VLAN IDs to 1..=4094 per IEEE 802.1Q - #356
Merged
Conversation
zeeshanlakhani
force-pushed
the
zl/vlan-range-fix
branch
from
August 30, 2026 10:22
1188d9d to
2a1fd4f
Compare
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.
zeeshanlakhani
force-pushed
the
zl/vlan-range-fix
branch
from
August 31, 2026 00:48
2a1fd4f to
5b4323a
Compare
taspelund
approved these changes
Aug 31, 2026
taspelund
left a comment
Contributor
There was a problem hiding this comment.
Changes look good. I'm excited to replace this with an oxnet type, but I know it's coming :-)
Contributor
Author
for sure. I hope to have a full oxnet (based on your branch) piece up for tmrw. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Now, we validate a
VLAN IDagainst the configurable range1..=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
VlanIdnewtype 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.