-
Notifications
You must be signed in to change notification settings - Fork 63
Add macOS user-mode networking support #100
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
Conversation
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.
3 issues found across 10 files
Prompt for AI agents (all 3 issues)
Understand the root cause of the following 3 issues and fix them.
<file name="netdev.c">
<violation number="1" location="netdev.c:94">
If `net_vmnet_init` fails, this path returns without freeing the vmnet state allocated just above, leaking memory. Consider freeing `netdev->op` (and nulling it) before returning false so repeated init attempts don't leak.</violation>
</file>
<file name="virtio-net.c">
<violation number="1" location="virtio-net.c:146">
The vmnet RX path treats a successful vnet_iovec_write() as an overflow, so normal packets are discarded and vmnet networking breaks.</violation>
</file>
<file name=".ci/test-netdev.sh">
<violation number="1" location=".ci/test-netdev.sh:85">
`udhcpc` stays attached to the shell by default; without `-q` it never returns the prompt, so this expect waits the full 600s timeout and the vmnet test hangs/fails. Please make the client exit after acquiring the lease.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
eb741fb to
69aff0a
Compare
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.
1 issue found across 14 files
Prompt for AI agents (all 1 issues)
Understand the root cause of the following 1 issues and fix them.
<file name="docs/networking.md">
<violation number="1" location="docs/networking.md:23">
Bridge mode is marked as supported for macOS vmnet, but the implementation only exposes shared mode today; please document bridge mode as unavailable until the CLI support lands.</violation>
</file>
React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.
2edbd29 to
0b7bb75
Compare
This enables SLIRP (userspace networking) and vmnet backend for macOS, providing both privileged (vmnet) and unprivileged (user) networking options. - virtio-net: Fix user mode RX/TX/refresh for cross-platform support - virtio-net: Fix vmnet RX path (vnet_iovec_write return value) - netdev: Add user mode initialization for macOS, fix error handling - netdev: Move Linux-only helpers inside platform guards - netdev-vmnet: Add vmnet.framework backend (C with Blocks) - ci: Enable recursive submodule checkout User mode (SLIRP) works without sudo on both Linux and macOS. vmnet mode requires sudo but provides better performance. Tested on macOS 14.6 arm64 - ping successful, 0% packet loss. Close #33
This enables SLIRP (userspace networking) and vmnet backend for macOS, providing both privileged (vmnet) and unprivileged (user) networking options.
User mode (SLIRP) works without sudo on both Linux and macOS. vmnet mode requires sudo but provides better performance.
Tested on macOS 14.6 arm64 - ping successful, 0% packet loss.
Close #33
Summary by cubic
Adds macOS networking with a vmnet backend (fast, needs sudo) and user-mode SLIRP (no sudo). Improves virtio-net for cross-platform user mode. Closes #33.
New Features
Migration