-
Notifications
You must be signed in to change notification settings - Fork 17
vm networking: add flag vnet_hdr #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,6 +30,11 @@ import ( | |||||||||
| "github.com/containerd/nerdbox/internal/vm" | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| const ( | ||||||||||
| NET_FLAG_VFKIT = 1 << iota // See https://github.com/containers/libkrun/blob/357ec63fee444b973e4fc76d2121fd41631f121e/include/libkrun.h#L271C9-L271C23 | ||||||||||
| NET_FLAG_INCLUDE_VNET_HEADER | ||||||||||
|
Comment on lines
+34
to
+35
|
||||||||||
| NET_FLAG_VFKIT = 1 << iota // See https://github.com/containers/libkrun/blob/357ec63fee444b973e4fc76d2121fd41631f121e/include/libkrun.h#L271C9-L271C23 | |
| NET_FLAG_INCLUDE_VNET_HEADER | |
| netFlagVfkit = 1 << iota // See https://github.com/containers/libkrun/blob/357ec63fee444b973e4fc76d2121fd41631f121e/include/libkrun.h#L271C9-L271C23 | |
| netFlagIncludeVnetHeader |
Copilot
AI
Feb 25, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a bitmask, using assignment here is slightly error-prone/inconsistent with the later OR operation. Using a bitwise-OR update for the vfkit flag too keeps the pattern uniform and avoids accidentally overwriting previously set bits if additional flags are added later.
| flags = NET_FLAG_VFKIT | |
| flags |= NET_FLAG_VFKIT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
vnet_hdrfield is parsed with strconv.ParseBool, but the docs don't describe what values are accepted (unlikevfkit, which lists the accepted boolean strings). Consider documenting the accepted boolean values (or referencing that it follows Go's ParseBool rules) for consistency and to reduce configuration errors.