Tun: add support for Darwin utun interface#4816
Merged
Merged
Conversation
Fixes secdev#4049 Darwin creates tunnel interfaces differently than BSD, breaking the existing handling which is based on generic BSD `tun`. This commit adds a new tunnel layer specific to the Darwin utun interface.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4816 +/- ##
==========================================
- Coverage 80.88% 80.88% -0.01%
==========================================
Files 368 368
Lines 90211 90231 +20
==========================================
+ Hits 72969 72983 +14
- Misses 17242 17248 +6
🚀 New features to boost your workflow:
|
Contributor
Author
gpotter2
reviewed
Sep 3, 2025
Contributor
Author
|
This PR has been open for a month and I haven't been seeing any new feedback. Is there some kind of additional test that should be added to facilitate things? This is my first time opening PR to this project so I'm not familiar with the maintainers expectations beyond what the docs already mentioned. |
Member
|
Hi. Sorry for the delay. I'm basically alone to review dozens of PRs, and I often don't have that much time to allocate to it ^^ It looks fine. Thanks for your work. |
gpotter2
approved these changes
Sep 13, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4049
Darwin creates tunnel interfaces differently than BSD, breaking the existing handling which is based on generic BSD
tun. This commit adds a new tunnel layer specific to the Darwin utun interface.This PR picks up the work after the draft PR #4100 got abandoned 2 years ago.
Checklist:
cd test && ./run_testsortox)TunTapInterfaceattempts to handle tunnels in Darwin by following the BSD code path. However, this fails for multiple reasons, including the initial rejection of the interface name beginning with "utun" rather than "tun". This PR adds special-case handling for Darwin.fixes #4049