Skip to content

Add bridged physical networking via vmnet-helper#1661

Open
s3rj1k wants to merge 1 commit into
apple:mainfrom
s3rj1k:vmnet-helper
Open

Add bridged physical networking via vmnet-helper#1661
s3rj1k wants to merge 1 commit into
apple:mainfrom
s3rj1k:vmnet-helper

Conversation

@s3rj1k

@s3rj1k s3rj1k commented Jun 8, 2026

Copy link
Copy Markdown

Add bridged physical networking via vmnet-helper with static IP and alias support

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

I, as a user, would like to have bridge support in containers, this change adds bridge support via external vmnet-helper

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

…lias support

Signed-off-by: s3rj1k <evasive.gyron@gmail.com>
@s3rj1k s3rj1k mentioned this pull request Jun 8, 2026
7 tasks
for fd in fds {
var sendSize = Self.socketSendBufferSize
var receiveSize = Self.socketReceiveBufferSize
_ = setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &sendSize, socklen_t(MemoryLayout<Int32>.size))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We're ignoring the return values on these setsockopt calls (_ = setsockopt(...)). If a system has a restrictive buffer ceiling set via sysctl (kern.ipc.maxsockbuf), the OS will truncate or reject these 1MB/4MB sizes. If that happens, the Virtualization framework might start throwing silent packet drops under high throughput. We should probably log a warning or check the return code here instead of discarding it completely.

}

var pollFd = pollfd(fd: fd, events: Int16(POLLIN), revents: 0)
let timeoutMs = Int32(min(remaining / .milliseconds(1), 1000))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Although this loop runs on a background GCD thread, poll can still lock up the thread for up to a full second per iteration. If the runtime tries to fire a cancel or shutdown signal, it won't be seen until the poll timeout drops, which will lag our teardown. Dropping the timeout value or passing a cancellation token down would make this a lot more responsive.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants