Skip to content

fix(plugin): check trunk id instead of minID in bounds validation#530

Open
filanov wants to merge 1 commit into
k8snetworkplumbingwg:mainfrom
filanov:fix-split-vlan-mid-id
Open

fix(plugin): check trunk id instead of minID in bounds validation#530
filanov wants to merge 1 commit into
k8snetworkplumbingwg:mainfrom
filanov:fix-split-vlan-mid-id

Conversation

@filanov

@filanov filanov commented Jun 4, 2026

Copy link
Copy Markdown

The condition was comparing minID against 4096 instead of the actual id value, allowing out-of-range individual trunk IDs to slip through undetected.

What this PR does / why we need it:

Special notes for your reviewer:

Release note:


@kubevirt-bot

Copy link
Copy Markdown
Collaborator

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubevirt-bot kubevirt-bot added do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 4, 2026
@kubevirt-bot

Copy link
Copy Markdown
Collaborator

Hi @filanov. Thanks for your PR.

I'm waiting for a k8snetworkplumbingwg member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Jun 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request fixes a bug in SplitVlanIds by replacing an incorrect check on minID with a check on the actual trunk id, and adds a corresponding test case. The review feedback correctly points out that the boundary check is off because the maximum valid VLAN ID is 4095; therefore, the validation should reject 4096 (using id >= 4096 instead of id > 4096). Additionally, the test case should be updated to use 4096 to properly verify this boundary condition.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pkg/plugin/plugin.go Outdated
Comment thread tests/cni/plugin_test.go Outdated

@ykulazhenkov ykulazhenkov 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.

LGTM

@kubevirt-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: filanov, ykulazhenkov
Once this PR has been reviewed and has the lgtm label, please assign alonakaplan for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 9, 2026
The condition was comparing minID against 4096 instead of the actual id value,
allowing out-of-range individual trunk IDs to slip through undetected.

Signed-off-by: Michael Filanov <mfilanov@nvidia.com>
@filanov filanov force-pushed the fix-split-vlan-mid-id branch from 434fa1b to 0271222 Compare June 11, 2026 09:15
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 11, 2026
@filanov

filanov commented Jun 22, 2026

Copy link
Copy Markdown
Author

@phoracek can you please take a look at this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has DCO signed all their commits. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants