nl80211: add wiphy network namespace support - #1203
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds Linux support for moving a wireless PHY into a network namespace using an ChangesWiphy network namespace operation
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Caller
participant Handle.WiphySetNsFd
participant nl80211
participant Kernel
Caller->>Handle.WiphySetNsFd: wiphy and netns fd
Handle.WiphySetNsFd->>nl80211: resolve generic netlink family
Handle.WiphySetNsFd->>nl80211: send SetWiphyNetns request with ACK
nl80211->>Kernel: apply wiphy and netnsFD attributes
Kernel-->>Handle.WiphySetNsFd: ACK or error
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Downstream integration draft: containernetworking/plugins#1274 That draft uses |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@wiphy_linux.go`:
- Around line 27-38: Update Handle.WiphySetNsFd to validate wiphy and fd are
non-negative before calling newWiphySetNsFdRequest, returning an appropriate
error for invalid values. Add the required fmt import and preserve the existing
family lookup and request execution flow for valid inputs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 43d5fea8-e9fc-4a42-b5f8-a8f355070a82
📒 Files selected for processing (2)
wiphy_linux.gowiphy_linux_test.go
|
Addressed the CodeRabbit finding in
The Linux CI failure in the previous run was that unrelated baseline error; macOS passed. |
|
CI rerun after
|
Summary
Add Linux-only helpers for moving a wireless PHY to another network namespace through the
nl80211generic-netlink family.This provides the dependency-layer API needed by
containernetworking/plugins#957, wherehost-devicecurrently cannot move wireless devices withRTM_SETLINK/LinkSetNsFd.The implementation sends
NL80211_CMD_SET_WIPHY_NETNSwith:NL80211_ATTR_WIPHYNL80211_ATTR_NETNS_FDBoth package-level and
Handlemethods are provided, following existing netlink API patterns.Testing
go build .— passedgo test ./nl— passedgo vet ./nl— passedhandle_retry_linux_test.goreferencing the missingHandle.RetryInterruptedmethod; this change does not reference that symbol.Related downstream integration: containernetworking/plugins#957
Summary by CodeRabbit
New Features
Tests